Arno Kaimbacher
b6fdfbff41
Some checks failed
CI Pipeline / japa-tests (push) Failing after 52s
- npm updated - added createHashValues and dlete inside File.ts - added dataset_count property inside Subject.ts - corrected rotes.ts with correct permissions
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
/*
|
|
|--------------------------------------------------------------------------
|
|
| Inertia Preloaded File
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Any code written inside this file will be executed during the application
|
|
| boot.
|
|
|
|
|
*/
|
|
|
|
import Inertia from '@ioc:EidelLev/Inertia';
|
|
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
|
|
|
|
Inertia.share({
|
|
errors: (ctx) => {
|
|
return ctx.session.flashMessages.get('errors');
|
|
},
|
|
|
|
flash: (ctx) => {
|
|
return {
|
|
message: ctx.session.flashMessages.get('message'),
|
|
warning: ctx.session.flashMessages.get('warning'),
|
|
};
|
|
},
|
|
|
|
// params: ({ params }) => params,
|
|
authUser: async ({ auth }: HttpContextContract) => {
|
|
if (auth.user) {
|
|
await auth.user.load('roles');
|
|
return auth.user;
|
|
// {
|
|
// 'id': auth.user.id,
|
|
// 'login': auth.user.login,
|
|
// };
|
|
} else {
|
|
return null;
|
|
}
|
|
},
|
|
}).version(() => Inertia.manifestFile('public/assets/manifest.json'));
|
|
|
|
// 'flash' => [
|
|
// 'message' => fn () => $request->session()->get('message'),
|
|
// ],
|