diff options
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | app/Controllers/Http/ServiceController.js | 17 | ||||
-rw-r--r-- | start/routes.js | 1 |
3 files changed, 20 insertions, 3 deletions
@@ -5,10 +5,9 @@ Unofficial Franz server replacement for use with the Ferdi Client. | |||
5 | 5 | ||
6 | ## Features | 6 | ## Features |
7 | - [x] User registration and login | 7 | - [x] User registration and login |
8 | - [x] Service creation, download and listing | 8 | - [x] Service creation, download, listing and removing |
9 | - [x] Workspace support | 9 | - [x] Workspace support |
10 | - [ ] Service removing | 10 | - [x] Functioning service store |
11 | - [ ] Functioning service store | ||
12 | 11 | ||
13 | ## Setup | 12 | ## Setup |
14 | 1. Clone this repository | 13 | 1. Clone this repository |
diff --git a/app/Controllers/Http/ServiceController.js b/app/Controllers/Http/ServiceController.js index 66cf6e0..e887e3a 100644 --- a/app/Controllers/Http/ServiceController.js +++ b/app/Controllers/Http/ServiceController.js | |||
@@ -225,6 +225,23 @@ class ServiceController { | |||
225 | }) { | 225 | }) { |
226 | return response.send([]) | 226 | return response.send([]) |
227 | } | 227 | } |
228 | |||
229 | async delete({ | ||
230 | request, | ||
231 | params, | ||
232 | auth, | ||
233 | response | ||
234 | }) { | ||
235 | // Update data in database | ||
236 | await (Service.query() | ||
237 | .where('serviceId', params.id) | ||
238 | .where('userId', auth.user.id)).delete() | ||
239 | |||
240 | return response.send({ | ||
241 | "message": "Sucessfully deleted service", | ||
242 | "status": 200 | ||
243 | }) | ||
244 | } | ||
228 | } | 245 | } |
229 | 246 | ||
230 | module.exports = ServiceController | 247 | module.exports = ServiceController |
diff --git a/start/routes.js b/start/routes.js index 55341f1..43c65e0 100644 --- a/start/routes.js +++ b/start/routes.js | |||
@@ -32,6 +32,7 @@ Route.group(() => { | |||
32 | // Service info | 32 | // Service info |
33 | Route.post('service', 'ServiceController.create').middleware('auth') | 33 | Route.post('service', 'ServiceController.create').middleware('auth') |
34 | Route.put('service/:id', 'ServiceController.edit').middleware('auth') | 34 | Route.put('service/:id', 'ServiceController.edit').middleware('auth') |
35 | Route.delete('service/:id', 'ServiceController.delete').middleware('auth') | ||
35 | Route.get('me/services', 'ServiceController.list').middleware('auth') | 36 | Route.get('me/services', 'ServiceController.list').middleware('auth') |
36 | Route.put('service/reorder', 'ServiceController.reorder').middleware('auth') | 37 | Route.put('service/reorder', 'ServiceController.reorder').middleware('auth') |
37 | Route.get('recipe', 'ServiceController.list').middleware('auth') | 38 | Route.get('recipe', 'ServiceController.list').middleware('auth') |