This commit is contained in:
Viet An
2026-06-04 16:12:51 +07:00
parent 2a1f85c2af
commit 3cfa103306
19 changed files with 106 additions and 106 deletions

View File

@@ -43,7 +43,7 @@ export default defineNuxtPlugin((nuxtApp) => {
$store.commit("snackbar", {
component,
vbind: {
content: typeof content == "string" ? content : JSON.stringify(content),
content: typeof content === "string" ? content : JSON.stringify(content),
},
});
};
@@ -190,7 +190,7 @@ export default defineNuxtPlugin((nuxtApp) => {
};
const copyToClipboard = function (text) {
snackbar("Copied to clipboard");
snackbar("Copied to clipboard", "Success");
if (window.clipboardData && window.clipboardData.setData) {
// IE specific code path to prevent textarea being shown while dialog is visible.
return clipboardData.setData("Text", text);
@@ -296,8 +296,8 @@ export default defineNuxtPlugin((nuxtApp) => {
};
const download = async function (url, fileName) {
let name = dayjs(new Date()).format("YYYYMMDDhhmmss") + "-" + fileName;
const response = await fetch(url, { method: "GET" });
const name = dayjs(new Date()).format("YYYYMMDDhhmmss") + "-" + fileName;
const response = await fetch(url);
const blob = await response.blob();
const urlDownload = window.URL.createObjectURL(blob);
const link = document.createElement("a");

View File

@@ -1516,9 +1516,7 @@ export default defineNuxtPlugin((nuxtApp) => {
}
try {
const response = await $fetch(url.toString(), {
method: "GET",
});
const response = await $fetch(url.toString());
if (response && response.pdf) {
const pdfUrl = `${apiBaseUrl}static/contract/${response.pdf}`;