feat: review model to retrieve all the questions with a single query
- update initial data - add description field to the axe
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import {Axe} from "~/repositories/models/axe.model";
|
||||
import {RestResponse} from "~/repositories/models/rest-response.model";
|
||||
import {$axios} from "~/utils/api";
|
||||
import {AxeWithQuestions} from "~/repositories/models/axe.model";
|
||||
|
||||
export default {
|
||||
findAll() {
|
||||
return $axios.get<RestResponse<Axe>>("/axes");
|
||||
return $axios.get<RestResponse<AxeWithQuestions>>("/axes/search/me");
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,19 @@
|
||||
import {RestLinks} from "~/repositories/models/rest-response.model";
|
||||
import {Question} from "~/repositories/models/question.model";
|
||||
|
||||
export interface Axe extends RestLinks {
|
||||
identifier: number;
|
||||
shortTitle: string;
|
||||
description: string;
|
||||
title: string;
|
||||
color: string;
|
||||
}
|
||||
|
||||
export interface AxeWithQuestions extends RestLinks {
|
||||
identifier: number;
|
||||
shortTitle: string;
|
||||
description: string;
|
||||
title: string;
|
||||
color: string;
|
||||
questions: Question[];
|
||||
}
|
||||
|
@@ -5,19 +5,6 @@ export interface Score {
|
||||
axeIdentifier: number;
|
||||
}
|
||||
|
||||
export interface Quiz extends RestLinks {
|
||||
id: number;
|
||||
createdDate: string;
|
||||
scores: Score[];
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
axeId: number;
|
||||
questionId: number;
|
||||
score?: number;
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
export interface ResponseWithQuestion extends RestLinks {
|
||||
axeIdentifier: number;
|
||||
question: string;
|
||||
@@ -25,6 +12,22 @@ export interface ResponseWithQuestion extends RestLinks {
|
||||
comment: string;
|
||||
}
|
||||
|
||||
export interface Quiz extends RestLinks {
|
||||
id: number;
|
||||
createdDate: string;
|
||||
scores: Score[];
|
||||
_embedded: {
|
||||
responses: ResponseWithQuestion[]
|
||||
};
|
||||
}
|
||||
|
||||
export interface Response {
|
||||
axeId: number;
|
||||
questionId: number;
|
||||
score?: number;
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
export interface QuizRate {
|
||||
score?: number;
|
||||
comment?: string;
|
||||
|
Reference in New Issue
Block a user