UPDATE: page deletion

page editor was missing soft delete of page as it had not been wired up
to the new api yet. oops
This commit is contained in:
ro 2024-07-06 16:23:23 -06:00
parent d24df50d96
commit ac543f3856
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
4 changed files with 16 additions and 3 deletions

View file

@ -29,4 +29,11 @@ class PageAPIController extends Controller
$result = $this->pages->create($body); $result = $this->pages->create($body);
return response()->json($result)->header('Content-Type', 'application/json'); return response()->json($result)->header('Content-Type', 'application/json');
} }
public function delete(Request $request)
{
$body = json_decode($request->getContent());
$result = $this->pages->delete($body);
return response()->json($result)->header('Content-Type', 'application/json');
}
} }

View file

@ -61,8 +61,9 @@ class PageRepository implements PageRepositoryInterface
return $page; return $page;
} }
public function delete($uuid) public function delete($page)
{ {
return $this->editPage($page, $this->pages->where('uuid', $page->uuid)->first(), 'delete');
} }
public function create($page) public function create($page)

View file

@ -259,7 +259,6 @@ class FipamoAdminAPI {
default: default:
break; break;
} }
if (this.baseURL) { if (this.baseURL) {
//data.key = this.key; //data.key = this.key;
data.remote = true; data.remote = true;
@ -385,7 +384,11 @@ class FipamoAdminAPI {
reject(error); reject(error);
} }
}; };
if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) { if (
requestType == REQUEST_TYPE_PUT ||
requestType == REQUEST_TYPE_POST ||
requestType == REQUEST_TYPE_DELETE
) {
if ( if (
eventType === TASK_SETTINGS_WRITE || eventType === TASK_SETTINGS_WRITE ||
eventType === TASK_PAGE_EDIT || eventType === TASK_PAGE_EDIT ||

View file

@ -24,6 +24,8 @@ Route::get("/v1/status", [AuthAPIController::class, 'status']);
//handle page editing actions //handle page editing actions
Route::put("/v1/page/write", [PageAPIController::class, 'write']); Route::put("/v1/page/write", [PageAPIController::class, 'write']);
Route::post("/v1/page/create", [PageAPIController::class, 'create']); Route::post("/v1/page/create", [PageAPIController::class, 'create']);
Route::delete("/v1/page/delete", [PageAPIController::class, 'delete']);
//handle file uploads //handle file uploads
Route::post("/v1/files", [FileUploadAPIController::class, 'upload']); Route::post("/v1/files", [FileUploadAPIController::class, 'upload']);
//settings //settings