This commit is contained in:
Daniel Brendel
2024-09-30 22:40:53 +02:00
parent acd2bf35b3
commit 1c5dbd306e
3 changed files with 33 additions and 5 deletions

View File

@@ -326,6 +326,30 @@ class ApiController extends BaseController {
}
}
/**
* Handles URL: /api/plants/gallery/remove
*
* @param Asatru\Controller\ControllerArg $request
* @return Asatru\View\JsonHandler
*/
public static function remove_plant_gallery_photo($request)
{
try {
$item = $request->params()->query('item', null);
PlantPhotoModel::removePhoto($item, true);
return json([
'code' => 200
]);
} catch (\Exception $e) {
return json([
'code' => 500,
'msg' => $e->getMessage()
]);
}
}
/**
* Handles URL: /api/plants/log/add
*