feat(backend): reactivate endpoint for dissolved colonies and inactive apiaries
Da fachliche Objekte nie hart geloescht werden (nur status + deactivatedAt), fehlte bisher ein Weg, ein versehentlich aufgeloestes Volk oder deaktivierten Bienenstand wieder zu aktivieren. Neue POST :id/reactivate-Endpunkte setzen status zurueck auf ACTIVE und loeschen deactivatedAt; ConflictException wenn bereits aktiv.
This commit is contained in:
1 parent
4a9fdd5c71
commit
6346bfab1d
8 files changed
+144
-2
No files matched your search
@@ -59,4 +59,10 @@ export class ApiariesController {
|
||||
deactivate(@Param('id') id: string, @CurrentUser() actor: AuthenticatedUser) {
|
||||
return this.apiariesService.deactivate(id, actor.id);
|
||||
}
|
||||
|
||||
@Roles(Role.ADMIN, Role.BEEKEEPER)
|
||||
@Post(':id/reactivate')
|
||||
reactivate(@Param('id') id: string, @CurrentUser() actor: AuthenticatedUser) {
|
||||
return this.apiariesService.reactivate(id, actor.id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user