diff --git a/app/Controllers/Http/Admin/AdminuserController.ts b/app/Controllers/Http/Admin/AdminuserController.ts index 2962cbd..05f25a4 100644 --- a/app/Controllers/Http/Admin/AdminuserController.ts +++ b/app/Controllers/Http/Admin/AdminuserController.ts @@ -85,9 +85,9 @@ export default class AdminuserController { // return response.badRequest(error.messages); throw error; } - - const input: Record = request.only(['login', 'email','first_name', 'last_name']); - input.password = request.input('new_password'); + + const input: Record = request.only(['login', 'email', 'first_name', 'last_name']); + input.password = request.input('new_password'); const user = await User.create(input); if (request.input('roles')) { const roles: Array = request.input('roles'); diff --git a/app/Controllers/Http/Admin/MimetypeController.ts b/app/Controllers/Http/Admin/MimetypeController.ts index 561c0ad..932fb55 100644 --- a/app/Controllers/Http/Admin/MimetypeController.ts +++ b/app/Controllers/Http/Admin/MimetypeController.ts @@ -33,7 +33,7 @@ export default class MimetypeController { // Step 2 - Validate request body against the schema // await request.validate({ schema: newDatasetSchema, messages: this.messages }); const validator = vine.compile(newDatasetSchema); - validator.messagesProvider = new SimpleMessagesProvider(this.messages); + validator.messagesProvider = new SimpleMessagesProvider(this.messages); await request.validateUsing(validator, { messagesProvider: new SimpleMessagesProvider(this.messages) }); } catch (error) { // Step 3 - Handle errors @@ -168,7 +168,7 @@ export default class MimetypeController { mimetype, }); } catch (error) { - if (error.code == 'E_ROW_NOT_FOUND') { + if (error.code === 'E_ROW_NOT_FOUND') { session.flash({ warning: 'Mimetype is not found in database' }); } else { session.flash({ warning: 'general error occured, you cannot delete the mimetype' }); diff --git a/app/Controllers/Http/Admin/mailsettings_controller.ts b/app/Controllers/Http/Admin/mailsettings_controller.ts index 628a9fc..332fd05 100644 --- a/app/Controllers/Http/Admin/mailsettings_controller.ts +++ b/app/Controllers/Http/Admin/mailsettings_controller.ts @@ -85,15 +85,14 @@ export default class MailSettingsController { } try { - await mail.send( - (message) => { - message - // .from(Config.get('mail.from.address')) - .from('tethys@geosphere.at') - .to(userEmail) - .subject('Test Email') - .html('

If you received this email, the email configuration seems to be correct.

'); - }); + await mail.send((message) => { + message + // .from(Config.get('mail.from.address')) + .from('tethys@geosphere.at') + .to(userEmail) + .subject('Test Email') + .html('

If you received this email, the email configuration seems to be correct.

'); + }); return response.json({ success: true, message: 'Test email sent successfully' }); // return response.flash('Test email sent successfully!', 'message').redirect().back(); diff --git a/config/inertia.ts b/config/inertia.ts index 7a13efc..1bbab4b 100644 --- a/config/inertia.ts +++ b/config/inertia.ts @@ -1,6 +1,7 @@ import { defineConfig } from '@adonisjs/inertia'; import type { HttpContext } from '@adonisjs/core/http'; -import type { InferSharedProps } from '@adonisjs/inertia/types' +import type { InferSharedProps } from '@adonisjs/inertia/types'; +import env from '#start/env'; const inertiaConfig = defineConfig({ /** @@ -21,6 +22,8 @@ const inertiaConfig = defineConfig({ return ctx.session?.flashMessages.get('user_id'); }, + opensearch_host: env.get('OPENSEARCH_HOST'), + flash: (ctx) => { return { message: ctx.session?.flashMessages.get('message'), diff --git a/resources/js/Components/Map/SearchMap.vue b/resources/js/Components/Map/SearchMap.vue index 25ce75d..efe8b02 100644 --- a/resources/js/Components/Map/SearchMap.vue +++ b/resources/js/Components/Map/SearchMap.vue @@ -1,5 +1,5 @@