feat: add delete signature function
This commit is contained in:
parent
c879e3f289
commit
dc3ec9d1c8
1 changed files with 13 additions and 1 deletions
|
|
@ -34,5 +34,17 @@ export async function setSignature(image: string) {
|
|||
|
||||
if (!userId) return;
|
||||
|
||||
return await api.put('/user/' + userId + '/signature', { data: image });
|
||||
if (image === '') {
|
||||
return await deleteSignature();
|
||||
} else {
|
||||
return await api.put('/user/' + userId + '/signature', { data: image });
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteSignature() {
|
||||
const userId = getUserId();
|
||||
|
||||
if (!userId) return;
|
||||
|
||||
return await api.delete('/user/' + userId + '/signature');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue