mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Display a toast message when document is duplicated succesfully
This commit is contained in:
parent
445e093a28
commit
1c87280b1e
@ -56,9 +56,15 @@ import CommentInput from './CommentInput.vue';
|
||||
import DocumentsList from './DocumentsList.vue';
|
||||
import DocumentActions from './DocumentActions.vue';
|
||||
import {makeFetch} from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { useToast } from "vue-toast-notification";
|
||||
import {
|
||||
DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS,
|
||||
trans
|
||||
} from 'translator';
|
||||
|
||||
const props = defineProps(['evaluation', 'docAnchorId']);
|
||||
const store = useStore();
|
||||
const toast = useToast();
|
||||
|
||||
const timeSpentChoices = [
|
||||
{ text: '1 minute', value: 60 },
|
||||
@ -215,15 +221,16 @@ function duplicateDocument(document) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function duplicateDocumentToEvaluation({evaluation, document}) {
|
||||
|
||||
const url = `/api/1.0/person/accompanying-course-work-evaluation-document/${document.id}/evaluation/${evaluation.id}/duplicate`;
|
||||
console.log('document id', document.id, 'evaluation id', evaluation.id)
|
||||
// console.log('document id', document.id, 'evaluation id', evaluation.id)
|
||||
|
||||
makeFetch("POST", url)
|
||||
.then((response) => {
|
||||
console.log('new document', response)
|
||||
this.$toast.open({ message: 'Le document a été dupliquer' });
|
||||
toast.open({ message: trans(DOCUMENT_DUPLICATE_TO_EVALUATION_SUCCESS) });
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user