forked from verdnatura/salix-front
20 lines
548 B
JavaScript
20 lines
548 B
JavaScript
|
import axios from 'axios';
|
||
|
import { defineStore } from 'pinia';
|
||
|
|
||
|
export const useValidationsStore = defineStore('validationsStore', {
|
||
|
state: () => ({
|
||
|
validations: null,
|
||
|
}),
|
||
|
actions: {
|
||
|
async fetchModels() {
|
||
|
if (this.validations) return;
|
||
|
try {
|
||
|
const { data } = await axios.get('Schemas/modelinfo');
|
||
|
this.validations = data;
|
||
|
} catch (error) {
|
||
|
console.error('Error al obtener las validaciones:', error);
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
});
|