- renamings to the new naming convetion for adonisjs version 6
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
- npm updates
This commit is contained in:
parent
bee76f8d5b
commit
a29865b781
53 changed files with 701 additions and 731 deletions
|
@ -13,7 +13,7 @@ import { DateTime } from 'luxon';
|
|||
import Index from '#app/Library/Utils/Index';
|
||||
import { getDomain } from '#app/Utils/utility-functions';
|
||||
import { DoiClient } from '#app/Library/Doi/DoiClient';
|
||||
import DoiClientException from '#app/Exceptions/DoiClientException';
|
||||
import DoiClientException from '#app/exceptions/DoiClientException';
|
||||
import logger from '@adonisjs/core/services/logger';
|
||||
import { HttpException } from 'node-exceptions';
|
||||
import { ModelQueryBuilderContract } from "@adonisjs/lucid/types/model";
|
||||
|
|
|
@ -10,8 +10,8 @@ import { readFileSync } from 'fs';
|
|||
import { StatusCodes } from 'http-status-codes';
|
||||
import SaxonJS from 'saxon-js';
|
||||
// import { Xslt, xmlParse } from 'xslt-processor'
|
||||
import { OaiErrorCodes, OaiModelError } from '#app/Exceptions/OaiErrorCodes';
|
||||
import { OaiModelException, BadOaiModelException } from '#app/Exceptions/OaiModelException';
|
||||
import { OaiErrorCodes, OaiModelError } from '#app/exceptions/OaiErrorCodes';
|
||||
import { OaiModelException, BadOaiModelException } from '#app/exceptions/OaiModelException';
|
||||
import Dataset from '#app/Models/Dataset';
|
||||
import Collection from '#app/Models/Collection';
|
||||
import { getDomain, preg_match } from '#app/Utils/utility-functions';
|
||||
|
|
|
@ -154,7 +154,7 @@ export default class DatasetController {
|
|||
rights: schema.string([rules.equalTo('true')]),
|
||||
});
|
||||
|
||||
await request.validate({ schema: newDatasetSchema, messages: this.messages });
|
||||
// await request.validate({ schema: newDatasetSchema, messages: this.messages });
|
||||
try {
|
||||
// Step 2 - Validate request body against the schema
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// import { Log } from '@adonisjs/core/build/standalone';
|
||||
// import { DoiInterface } from './interfaces/DoiInterface';
|
||||
import DoiClientContract from '#app/Library/Doi/DoiClientContract';
|
||||
import DoiClientException from '#app/Exceptions/DoiClientException';
|
||||
import DoiClientException from '#app/exceptions/DoiClientException';
|
||||
import { StatusCodes } from 'http-status-codes';
|
||||
import logger from '@adonisjs/core/services/logger';
|
||||
import { AxiosResponse } from 'axios';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import ResumptionToken from './ResumptionToken.js';
|
||||
import { createClient, RedisClientType } from 'redis';
|
||||
import InternalServerErrorException from '#app/Exceptions/InternalServerException';
|
||||
import InternalServerErrorException from '#app/exceptions/InternalServerException';
|
||||
import { sprintf } from 'sprintf-js';
|
||||
import dayjs from 'dayjs';
|
||||
import TokenWorkerContract from './TokenWorkerContract.js';
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
// import db from '@adonisjs/lucid/services/db';
|
||||
// // import Config from '@ioc:Adonis/Core/Config';
|
||||
// import config from '@adonisjs/core/services/config';
|
||||
// import { QueryClientContract } from "@adonisjs/lucid/types/database";
|
||||
// import { TransactionClientContract } from "@adonisjs/lucid/types/database";
|
||||
|
||||
// export function getUserRoles(userId: number, trx?: TransactionClientContract): Promise<Array<string>> {
|
||||
// const { userRole } = config.get('acl.joinTables');
|
||||
// return ((trx || db) as QueryClientContract | TransactionClientContract)
|
||||
// .query()
|
||||
// .from('roles')
|
||||
// .distinct('roles.slug')
|
||||
// .leftJoin(userRole, `${userRole}.role_id`, 'roles.id')
|
||||
// .where(`${userRole}.user_id`, userId)
|
||||
// .then((res) => {
|
||||
// return res.map((r) => r.slug);
|
||||
// });
|
||||
// }
|
|
@ -29,7 +29,7 @@ export default class HttpExceptionHandler extends ExceptionHandler {
|
|||
* codes. You might want to enable them in production only, but feel
|
||||
* free to enable them in development as well.
|
||||
*/
|
||||
protected renderStatusPages = app.inProduction;
|
||||
protected renderStatusPages = true; //app.inProduction;
|
||||
|
||||
/**
|
||||
* Status pages is a collection of error code range and a callback
|
||||
|
@ -68,7 +68,7 @@ export default class HttpExceptionHandler extends ExceptionHandler {
|
|||
// }
|
||||
|
||||
public async handle(error: any, ctx: HttpContext) {
|
||||
// const { response, request, session, inertia } = ctx;
|
||||
const { response, request, session, inertia } = ctx;
|
||||
|
||||
/**
|
||||
* Handle failed authentication attempt
|
||||
|
@ -86,17 +86,18 @@ export default class HttpExceptionHandler extends ExceptionHandler {
|
|||
// let test = response.getStatus(); //200
|
||||
// let header = request.header('X-Inertia'); // true
|
||||
// if (request.header('X-Inertia') && [500, 503, 404, 403, 401, 200].includes(response.getStatus())) {
|
||||
// // session.flash('errors', error.messages.errors);
|
||||
// session.flash('errors', error.messages);
|
||||
// return response.redirect().back();
|
||||
// // return inertia.render('errors/server_error', {
|
||||
// // return inertia.render('errors/server_error', {
|
||||
// // // status: response.getStatus(),
|
||||
// // error: error,
|
||||
// // });
|
||||
// // ->toResponse($request)
|
||||
// // ->setStatusCode($response->status());
|
||||
// }
|
||||
if (request.header('X-Inertia') && [422].includes(error.status)) {
|
||||
// session.flash('errors', error.messages.errors);
|
||||
session.flash('errors', error.messages);
|
||||
return response.redirect().back();
|
||||
// return inertia.render('errors/server_error', {
|
||||
// return inertia.render('errors/server_error', {
|
||||
// // status: response.getStatus(),
|
||||
// error: error,
|
||||
// });
|
||||
// ->toResponse($request)
|
||||
// ->setStatusCode($response->status());
|
||||
}
|
||||
// Dynamically change the error templates based on the absence of X-Inertia header
|
||||
// if (!ctx.request.header('X-Inertia')) {
|
||||
// this.statusPages = {
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue