diff --git a/app/Controllers/Http/SettingsController.ts b/app/Controllers/Http/SettingsController.ts index 515588c..df7ce22 100644 --- a/app/Controllers/Http/SettingsController.ts +++ b/app/Controllers/Http/SettingsController.ts @@ -22,19 +22,13 @@ export default class SettingsController { } - public async get({params, auth}: HttpContextContract): Promise { + public async get({params, auth, response}: HttpContextContract): Promise { const key = params.key - try { - const result = auth.user.related('settings').query().select(['key', 'value']).where('key', key).first() + const result = await auth.user.related('settings').query().select(['key', 'value']).where('key', key).firstOrFail() - return result - } - catch(error) { - return error - } - + return result } /**