formatting
This commit is contained in:
2
mod.ts
2
mod.ts
@@ -78,8 +78,8 @@ Deno.serve({ port: config.api.port }, async (req) => {
|
|||||||
} else if (path === '/create') {
|
} else if (path === '/create') {
|
||||||
if (body.planName.trim().length > 200) return genericResponse(STATUS_CODE.BadRequest, 'Name too long.');
|
if (body.planName.trim().length > 200) return genericResponse(STATUS_CODE.BadRequest, 'Name too long.');
|
||||||
if (body.folder.trim() && body.folder.trim().length > 200) return genericResponse(STATUS_CODE.BadRequest, 'Folder name too long.');
|
if (body.folder.trim() && body.folder.trim().length > 200) return genericResponse(STATUS_CODE.BadRequest, 'Folder name too long.');
|
||||||
const newPlanId = nanoid();
|
|
||||||
|
|
||||||
|
const newPlanId = nanoid();
|
||||||
await dbClient
|
await dbClient
|
||||||
.execute('INSERT INTO plans(id,ownerId,name,folder,data) values(?,?,?,?,?)', [newPlanId, id, body.planName.trim(), body.folder.trim(), body.data])
|
.execute('INSERT INTO plans(id,ownerId,name,folder,data) values(?,?,?,?,?)', [newPlanId, id, body.planName.trim(), body.folder.trim(), body.data])
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user