fix: update OpenSearch host configuration and improve code consistency across controllers and components
This commit is contained in:
parent
9c0221ce27
commit
6c75efbc28
7 changed files with 368 additions and 141 deletions
|
|
@ -85,9 +85,9 @@ export default class AdminuserController {
|
|||
// return response.badRequest(error.messages);
|
||||
throw error;
|
||||
}
|
||||
|
||||
const input: Record<string, any> = request.only(['login', 'email','first_name', 'last_name']);
|
||||
input.password = request.input('new_password');
|
||||
|
||||
const input: Record<string, any> = 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<number> = request.input('roles');
|
||||
|
|
|
|||
|
|
@ -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' });
|
||||
|
|
|
|||
|
|
@ -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('<p>If you received this email, the email configuration seems to be correct.</p>');
|
||||
});
|
||||
await mail.send((message) => {
|
||||
message
|
||||
// .from(Config.get('mail.from.address'))
|
||||
.from('tethys@geosphere.at')
|
||||
.to(userEmail)
|
||||
.subject('Test Email')
|
||||
.html('<p>If you received this email, the email configuration seems to be correct.</p>');
|
||||
});
|
||||
|
||||
return response.json({ success: true, message: 'Test email sent successfully' });
|
||||
// return response.flash('Test email sent successfully!', 'message').redirect().back();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue