Files
boussole-pluss/frontend/store/bundle.ts
Nicolas Doby 5d884b1be6 feat: review backend and frontend
- update to the latest version of Java/SpringBoot
- update to the latest version NuxtJS
- add account/password update
- add account creation
- add account password reset
- add bundle to regroup questions and add default questions on user creation
- add bundle creation
2024-07-09 14:37:43 +02:00

39 lines
672 B
TypeScript

import {defineStore} from 'pinia';
export interface Bundle {
id: number;
label: string;
lastQuizzDate: string;
numberOfQuizzes: number;
}
export interface QuestionCreation {
label: string;
description: string;
axeId: number;
}
export interface BundleCreationRequest {
label: string;
questions: QuestionCreation[];
}
export const useBundleStore = defineStore('bundle', {
state: () => ({
selectedBundle: Number,
}),
actions: {
findAll(): Bundle[] {
return useApi("bundles");
},
create(request: BundleCreationRequest) {
return useApi("bundles", {
method: "POST",
body: request
});
}
}
});