mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
Reset default tag on delete
This commit is contained in:
parent
9cc5b50b6d
commit
8630a3a427
1 changed files with 10 additions and 0 deletions
|
|
@ -507,6 +507,16 @@ App::delete('/v1/functions/:functionId/tags/:tagId')
|
|||
}
|
||||
}
|
||||
|
||||
if($function->getAttribute('tag') === $tag->getId()) { // Reset function tag
|
||||
$function = $projectDB->updateDocument(array_merge($function->getArrayCopy(), [
|
||||
'tag' => '',
|
||||
]));
|
||||
|
||||
if (false === $function) {
|
||||
throw new Exception('Failed saving function to DB', 500);
|
||||
}
|
||||
}
|
||||
|
||||
$usage
|
||||
->setParam('storage', $tag->getAttribute('codeSize', 0) * -1)
|
||||
;
|
||||
|
|
|
|||
Loading…
Reference in a new issue