fix: add refresh after crd operation in membership contd

This commit is contained in:
caturbgs
2021-12-22 23:43:45 +07:00
parent 38c4aca9be
commit 7e356d0178
2 changed files with 26 additions and 33 deletions

View File

@@ -49,9 +49,6 @@ export class Membership {
async create(data) {
try {
const response = await http.post('/users').send(data);
this.ctx.authentication.userData.role === "Admin"
? await this.ctx.membership.getData()
: await this.ctx.membership.getDataBySuperior();
return response;
} catch (e) {
console.error(e);
@@ -61,9 +58,6 @@ export class Membership {
async update(id, data) {
try {
const response = await http.put('/users/' + id).send(data);
this.ctx.authentication.userData.role === "Admin"
? await this.ctx.membership.getData()
: await this.ctx.membership.getDataBySuperior();
return response;
} catch (e) {
console.error(e);
@@ -73,9 +67,6 @@ export class Membership {
async delete(id) {
try {
const response = await http.del('/users/' + id);
this.ctx.authentication.userData.role === "Admin"
? await this.ctx.membership.getData()
: await this.ctx.membership.getDataBySuperior();
return response;
} catch (e) {
console.error(e);