mirror of
https://github.com/sussy-code/backend.git
synced 2026-04-21 00:42:02 +00:00
Apply suggestions from code review
This commit is contained in:
parent
8a3c0d6edb
commit
6d2dcd04e9
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ export const sessionRouter = makeRouter((app) => {
|
||||||
sid: z.string(),
|
sid: z.string(),
|
||||||
}),
|
}),
|
||||||
body: z.object({
|
body: z.object({
|
||||||
name: z.string().min(1).optional(),
|
deviceName: z.string().min(1).optional(),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -53,7 +53,7 @@ export const sessionRouter = makeRouter((app) => {
|
||||||
if (targetedSession.id !== params.sid)
|
if (targetedSession.id !== params.sid)
|
||||||
throw new StatusError('Cannot edit sessions other than your own', 401);
|
throw new StatusError('Cannot edit sessions other than your own', 401);
|
||||||
|
|
||||||
if (body.name) targetedSession.device = body.name;
|
if (body.deviceName) targetedSession.device = body.deviceName;
|
||||||
|
|
||||||
await em.persistAndFlush(targetedSession);
|
await em.persistAndFlush(targetedSession);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue