feat: add color to project
This commit is contained in:
parent
c944d19c3b
commit
9a34965432
5 changed files with 1371 additions and 268 deletions
|
|
@ -18,6 +18,7 @@ export namespace Project {
|
|||
vcs: z.literal("git").optional(),
|
||||
name: z.string().optional(),
|
||||
icon: z.string().optional(),
|
||||
color: z.string().optional(),
|
||||
time: z.object({
|
||||
created: z.number(),
|
||||
updated: z.number().optional(),
|
||||
|
|
@ -134,11 +135,13 @@ export namespace Project {
|
|||
projectID: z.string(),
|
||||
name: z.string().optional(),
|
||||
icon: z.string().optional(),
|
||||
color: z.string().optional(),
|
||||
}),
|
||||
async (input) => {
|
||||
return await Storage.update<Info>(["project", input.projectID], (draft) => {
|
||||
if (input.name !== undefined) draft.name = input.name
|
||||
if (input.icon !== undefined) draft.icon = input.icon
|
||||
if (input.color !== undefined) draft.color = input.color
|
||||
draft.time.updated = Date.now()
|
||||
})
|
||||
},
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export const ProjectRoute = new Hono()
|
|||
"/:projectID",
|
||||
describeRoute({
|
||||
summary: "Update project",
|
||||
description: "Update project properties such as name and icon.",
|
||||
description: "Update project properties such as name, icon and color.",
|
||||
operationId: "project.update",
|
||||
responses: {
|
||||
200: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue