refactor: signature endpoints
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 8s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 8s
This commit is contained in:
parent
4c47b0b7d1
commit
df8ef4db33
1 changed files with 7 additions and 1 deletions
|
|
@ -896,7 +896,7 @@ export class UserSignatureController extends Controller {
|
|||
@Get()
|
||||
async getSignature(@Request() req: RequestWithUser, @Path() userId: string) {
|
||||
this.#checkPermission(req, userId);
|
||||
return req.res?.redirect(await getFile(fileLocation.user.signature(userId)));
|
||||
return await getFile(fileLocation.user.signature(userId));
|
||||
}
|
||||
|
||||
@Put()
|
||||
|
|
@ -917,4 +917,10 @@ export class UserSignatureController extends Controller {
|
|||
return await setFile(fileLocation.user.signature(userId));
|
||||
}
|
||||
}
|
||||
|
||||
@Delete()
|
||||
async deleteSignature(@Request() req: RequestWithUser, @Path() userId: string) {
|
||||
this.#checkPermission(req, userId);
|
||||
await deleteFile(fileLocation.user.signature(userId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue