-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: HandleDashboardUserPostLogin API
- Loading branch information
Showing
9 changed files
with
210 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package api | ||
|
||
import "github.com/basemind-ai/monorepo/go-shared/db" | ||
|
||
type HandleDashboardUserPostLoginDTO struct { | ||
User db.User `json:"user"` | ||
Projects []db.FindProjectsByUserIdRow `json:"projects"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
-- name: CheckUserExists :one | ||
SELECT EXISTS(SELECT 1 FROM "user" WHERE firebase_id = $1); | ||
|
||
-- name: CreateUser :one | ||
INSERT INTO "user" (firebase_id) values ($1) | ||
RETURNING *; | ||
|
||
-- name: FindUserByFirebaseId :one | ||
SELECT id, firebase_id, created_at from "user" where firebase_id = $1; | ||
|
||
-- name: FindProjectsByUserId :many | ||
Select id, name, description, permission, is_user_default_project, created_at from project p inner join user_project up on p.id = up.project_id where up.user_id = $1; | ||
|
||
-- name: CreateProject :one | ||
INSERT INTO project (name, description) values ($1, $2) | ||
RETURNING *; | ||
|
||
-- name: CreateUserProject :one | ||
INSERT INTO user_project (user_id, project_id, permission, is_user_default_project) values ($1, $2, $3, $4) | ||
RETURNING *; |