tethys.backend/start/inertia.ts
Arno Kaimbacher 4714dfdd94
All checks were successful
CI Pipeline / japa-tests (push) Successful in 46s
- use latest prettier 3.0 with eslint-plugin-prettier: 5.0.0-alpha.2
- npm normal updates
- add all xslt and style asstes in extra folder public/assets2
- linting corrections
- delete local .env.test from git tracking: git rm --cached .env.test
- add .env.test into .gitignore file
- add edit functionality for editing by submitter
- npm updates
-added xslt3 packeage for builfing sef files
- added Language.ts class vor language table
- added version to datasetxml2oai-pmh.xslt
2023-07-17 19:13:30 +02:00

43 lines
1.1 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: ({ auth }: HttpContextContract) => {
if (auth.user) {
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'),
// ],