Skip to content

Commit

Permalink
link new contributor route w accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
dromzeh committed Dec 18, 2023
1 parent 2bf7240 commit fe8fd09
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/v2/db/schema/user/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export const authUser = sqliteTable(
userIdx: index("user_id_idx").on(user.id),
usernameIdx: index("user_username_idx").on(user.username),
emailIdx: index("user_email_idx").on(user.email),
contributorIdx: index("user_contributor_idx").on(
user.isContributor
),
}
}
)
Expand Down
8 changes: 4 additions & 4 deletions src/v2/routes/asset/upload/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export const uploadAssetSchema = z.object({
),
name: z.string().min(3).max(32).openapi({
description: "The name of the asset.",
example: "asset",
example: "keqing-nobg.png",
}),
tags: z
.string()
.openapi({
description: "Comma seperated list of tags for the asset.",
example: "tag1,tag2,tag3",
example: "official,1.0",
})
.optional(),
assetCategoryId: z.string().openapi({
description: "The asset category ID for the asset.",
example: "assetCategoryId",
example: "splash-art",
}),
gameId: z.string().openapi({
description: "The game ID for the asset.",
example: "gameId",
example: "genshin-impact",
}),
})
2 changes: 1 addition & 1 deletion src/v2/routes/contributors/get/all/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const contributorsRoute = createRoute({
tags: ["Contributors"],
responses: {
200: {
description: "All Contributors",
description: "All Contributors.",
},
500: {
description: "Internal server error.",
Expand Down
8 changes: 8 additions & 0 deletions src/v2/routes/contributors/handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { OpenAPIHono } from "@hono/zod-openapi"
import AllContributorsRoute from "@/v2/routes/contributors/get/all/route"

const handler = new OpenAPIHono<{ Bindings: Bindings; Variables: Variables }>()

handler.route("/get/list", AllContributorsRoute)

export default handler
2 changes: 2 additions & 0 deletions src/v2/routes/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { OpenAPIHono } from "@hono/zod-openapi"
import UserRoute from "@/v2/routes/user/handler"
import GameRoute from "@/v2/routes/game/handler"
import AssetRoute from "@/v2/routes/asset/handler"
import ContributorRoute from "@/v2/routes/contributors/handler"
import AuthRoute from "@/v2/routes/auth/handler"

const handler = new OpenAPIHono<{ Bindings: Bindings; Variables: Variables }>()

handler.route("/game", GameRoute)
handler.route("/asset", AssetRoute)
handler.route("/user", UserRoute)
handler.route("/contributors", ContributorRoute)
handler.route("/auth", AuthRoute)

export default handler

0 comments on commit fe8fd09

Please sign in to comment.