diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:36:47 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 21:37:42 +0900 |
| commit | 922d9348cf59df248873e27af3b27dbb0d93d9b1 (patch) | |
| tree | c0ec259659fc0244c22750a7e18451efbe13446d /backend/api | |
| parent | f6443042fbec1bd394439904f3c69e23709f7e6a (diff) | |
| download | phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.tar.gz phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.tar.zst phperkaigi-2025-albatross-922d9348cf59df248873e27af3b27dbb0d93d9b1.zip | |
refactor(backend): `Id` to `ID` in sqlc
Diffstat (limited to 'backend/api')
| -rw-r--r-- | backend/api/handlers.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/api/handlers.go b/backend/api/handlers.go index 35fc9f7..aba9366 100644 --- a/backend/api/handlers.go +++ b/backend/api/handlers.go @@ -62,7 +62,7 @@ func (h *ApiHandler) AdminGetGames(ctx context.Context, request AdminGetGamesReq func (h *ApiHandler) AdminGetGame(ctx context.Context, request AdminGetGameRequestObject, user *auth.JWTClaims) (AdminGetGameResponseObject, error) { gameID := request.GameId - row, err := h.q.GetGameById(ctx, int32(gameID)) + row, err := h.q.GetGameByID(ctx, int32(gameID)) if err != nil { if errors.Is(err, pgx.ErrNoRows) { return AdminGetGame404JSONResponse{ @@ -111,7 +111,7 @@ func (h *ApiHandler) AdminPutGame(ctx context.Context, request AdminPutGameReque startedAt := request.Body.StartedAt state := request.Body.State - game, err := h.q.GetGameById(ctx, int32(gameID)) + game, err := h.q.GetGameByID(ctx, int32(gameID)) if err != nil { if err == pgx.ErrNoRows { return AdminPutGame404JSONResponse{ @@ -220,7 +220,7 @@ func (h *ApiHandler) PostLogin(ctx context.Context, request PostLoginRequestObje }, nil } - user, err := h.q.GetUserById(ctx, int32(userID)) + user, err := h.q.GetUserByID(ctx, int32(userID)) if err != nil { return PostLogin401JSONResponse{ UnauthorizedJSONResponse: UnauthorizedJSONResponse{ @@ -289,7 +289,7 @@ func (h *ApiHandler) GetGames(ctx context.Context, request GetGamesRequestObject func (h *ApiHandler) GetGame(ctx context.Context, request GetGameRequestObject, user *auth.JWTClaims) (GetGameResponseObject, error) { // TODO: check user permission gameID := request.GameId - row, err := h.q.GetGameById(ctx, int32(gameID)) + row, err := h.q.GetGameByID(ctx, int32(gameID)) if err != nil { if errors.Is(err, pgx.ErrNoRows) { return GetGame404JSONResponse{ |
