Skip to content

Commit

Permalink
Feat: show message
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyCreeper committed Dec 17, 2023
1 parent 28494fd commit f2e4637
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/hooks/admin/setting/useVendor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ref } from "vue";
import { ElNotification } from "element-plus";
import { ElNotification, ElMessage } from "element-plus";
import { userStore } from "@/stores/user";
import {
getVendorsListApi,
Expand Down Expand Up @@ -51,7 +51,7 @@ export const useVendorApi = () => {
return state;
};

const deleteVendor = async (endpoints: string[]) => {
const deleteVendor = async (endpoints: string[], showMsg = false) => {
const { execute, state } = deleteVendorApi();
try {
await execute({
Expand All @@ -62,6 +62,7 @@ export const useVendorApi = () => {
endpoints
}
});
showMsg && ElMessage.success("删除成功");
} catch (err) {
errorCatch(err);
}
Expand All @@ -85,11 +86,7 @@ export const useVendorApi = () => {
max: pageSize.value
});
if (vendorsListState.value) {
showMsg &&
ElNotification({
title: "更新成功",
type: "success"
});
showMsg && ElMessage.success("更新成功");
}
} catch (err: any) {
errorCatch(err);
Expand Down

0 comments on commit f2e4637

Please sign in to comment.