Merge pull request #182 from dderbentsov/UC-162
[WIP] Фикс апдейта данных клиента и просроченного токена
This commit is contained in:
@@ -118,10 +118,6 @@ export default {
|
||||
this.fetchDataClients();
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
localStorage.removeItem("tokenAccess");
|
||||
this.$router.push("/login");
|
||||
},
|
||||
async fetchDataClients() {
|
||||
let response = {};
|
||||
if (this.textSearch) {
|
||||
@@ -130,32 +126,24 @@ export default {
|
||||
this.limit
|
||||
}&offset=${(this.currentTablePage - 1) * this.limit}`
|
||||
);
|
||||
if (response.type === "client_error") {
|
||||
this.logout();
|
||||
} else {
|
||||
this.saveDataClients(response);
|
||||
this.saveFilteredClientsCount(response);
|
||||
this.paginationInfo = {
|
||||
currentPage: this.currentTablePage,
|
||||
length: this.calculatePageCount(this.filteredClientsCount),
|
||||
};
|
||||
}
|
||||
this.saveDataClients(response);
|
||||
this.saveFilteredClientsCount(response);
|
||||
this.paginationInfo = {
|
||||
currentPage: this.currentTablePage,
|
||||
length: this.calculatePageCount(this.filteredClientsCount),
|
||||
};
|
||||
} else {
|
||||
response = await fetchWrapper.get(
|
||||
`general/person/?limit=${this.limit}&offset=${
|
||||
(this.currentTablePage - 1) * this.limit
|
||||
}`
|
||||
);
|
||||
if (response.type === "client_error") {
|
||||
this.logout();
|
||||
} else {
|
||||
this.saveDataClients(response);
|
||||
this.saveClientsCount(response);
|
||||
this.paginationInfo = {
|
||||
currentPage: this.currentTablePage,
|
||||
length: this.calculatePageCount(this.clientsCount),
|
||||
};
|
||||
}
|
||||
this.saveDataClients(response);
|
||||
this.saveClientsCount(response);
|
||||
this.paginationInfo = {
|
||||
currentPage: this.currentTablePage,
|
||||
length: this.calculatePageCount(this.clientsCount),
|
||||
};
|
||||
}
|
||||
},
|
||||
calculatePageCount(count) {
|
||||
|
||||
Reference in New Issue
Block a user