changes
This commit is contained in:
@@ -31,12 +31,11 @@ export default {
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
if (!this.approvalcode && this.$store.state.login.approval_code)
|
||||
this.approvalcode = this.$store.state.login.approval_code;
|
||||
if (!this.approvalcode && this.$store.login.approval_code) this.approvalcode = this.$store.login.approval_code;
|
||||
if (!this.approvalcode) {
|
||||
const user = await this.$getdata("user", {
|
||||
first: true,
|
||||
filter: { id: this.$store.state.login.id },
|
||||
filter: { id: this.$store.login.id },
|
||||
});
|
||||
this.approvalcode = user.approval_code;
|
||||
}
|
||||
@@ -47,7 +46,7 @@ export default {
|
||||
computed: {
|
||||
approvalcode: {
|
||||
get() {
|
||||
return this.$store.state["approvalcode"];
|
||||
return this.$store.approvalcode;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("updateStore", { name: "approvalcode", data: val });
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
if (this.setdeleted) {
|
||||
let record = await this.$getdata(name, { first: true, filter: { id } });
|
||||
record.deleted = 1;
|
||||
result = await this.$patchapi(name, record);
|
||||
result = await this.$patchapi(name, { data: record });
|
||||
} else result = await this.$deleteapi(name, id);
|
||||
if (result === "error") return this.$dialog("Đã xảy ra lỗi, xóa dữ liệu thất bại", "Lỗi", "Error");
|
||||
this.$snackbar("Dữ liệu đã được xoá khỏi hệ thống", "Success");
|
||||
|
||||
Reference in New Issue
Block a user