| @@ 76-87 (lines=12) @@ | ||
| 73 | return redirect()->route('account.api.new')->withInput(); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function revoke(Request $request, $key) |
|
| 77 | { |
|
| 78 | try { |
|
| 79 | $repo = new APIRepository($request->user()); |
|
| 80 | $repo->revoke($key); |
|
| 81 | ||
| 82 | return response('', 204); |
|
| 83 | } catch (\Exception $ex) { |
|
| 84 | return response()->json([ |
|
| 85 | 'error' => 'An error occured while attempting to remove this key.', |
|
| 86 | ], 503); |
|
| 87 | } |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| @@ 79-93 (lines=15) @@ | ||
| 76 | return response('', 204); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function patchLocation(Request $request, $id) |
|
| 80 | { |
|
| 81 | try { |
|
| 82 | $location = new LocationRepository; |
|
| 83 | $location->edit($id, $request->all()); |
|
| 84 | ||
| 85 | return response('', 204); |
|
| 86 | } catch (DisplayValidationException $ex) { |
|
| 87 | return response()->json([ |
|
| 88 | 'error' => 'There was a validation error while processing this request. Location descriptions must be between 1 and 255 characters, and the location code must be between 1 and 10 characters with no spaces or special characters.', |
|
| 89 | ], 422); |
|
| 90 | } catch (\Exception $ex) { |
|
| 91 | // This gets caught and processed into JSON anyways. |
|
| 92 | throw $ex; |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | public function postLocation(Request $request) |
|