mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
Mark model
as unused in canEdit
This commit is contained in:
parent
15c8d928c0
commit
ab89b3e464
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||||
handleInterrupts(res, async () => {
|
handleInterrupts(res, async () => {
|
||||||
const user = await authorizeUser(req, res)
|
const user = await authorizeUser(req, res)
|
||||||
|
|
||||||
const canEdit = async (model: Model, obj?: Event) => {
|
const canEdit = async (_model: Model, obj?: Event) => {
|
||||||
if(obj && obj.creatorId !== user.id) {
|
if(obj && obj.creatorId !== user.id) {
|
||||||
throw new Interrupt(403, {error: "Only the creator can edit an event"})
|
throw new Interrupt(403, {error: "Only the creator can edit an event"})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue