revisions complete

This commit is contained in:
2023-10-15 19:14:07 +03:00
parent 1faac31372
commit 8d3e8373c0
16 changed files with 288 additions and 218 deletions
+15 -16
View File
@@ -341,20 +341,19 @@ class RecordController extends Controller
}
return ok();
}
//
// public function rollback(Request $request)
// {
// try {
// $this->recordService->rollback(
// userId: AuthService::currentUserId($request),
// recordId: $request->route("rid"),
// version: (int)$request->route("version")
// );
// } catch (ValidatorException $th) {
// return fail($th->getFirstValidatorError());
// } catch (LucentException|Throwable $th) {
// return fail($th);
// }
// return ok();
// }
public function rollback(Request $request)
{
try {
$this->recordService->rollback(
recordId: $request->route("rid"),
version: (int)$request->route("version")
);
} catch (ValidatorException $th) {
return fail($th->getFirstValidatorError());
} catch (LucentException|Throwable $th) {
return fail($th);
}
return ok();
}
}