add: Form create load

This commit is contained in:
Alexandro Uc Santos
2023-12-07 18:04:17 -06:00
parent 2c74a4b3ae
commit cea26e1f6e
29 changed files with 1292 additions and 59 deletions

View File

@@ -0,0 +1,30 @@
import { ref } from "vue";
import { useLoadsStore } from "../stores/loads";
import api from "../lib/axios";
export default function useAttachments() {
const loading = ref(false);
const attachments = ref(null);
const loadStore = useLoadsStore();
const getAttachmentLoad = async() => {
try {
loading.value = true;
const endpoint = "/v1" + "/load-attachments/load/" + loadStore.currentLoad._id;
const {data} = await api.get(endpoint);
attachments.value = data;
} catch (error) {
attachments.value = null;
console.log(error);
} finally {
loading.value = false;
}
}
return {
getAttachmentLoad,
loading,
attachments
}
}