Merge branch 'develop' into 'devops-staging'
fix: add refresh after crd operation in membership See merge request empatnusabangsa/ppob/ppob-frontend!10
This commit is contained in:
commit
00a3d0aa08
|
@ -48,7 +48,11 @@ export class Membership {
|
||||||
|
|
||||||
async create(data) {
|
async create(data) {
|
||||||
try {
|
try {
|
||||||
return await http.post('/users').send(data)
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -57,8 +61,10 @@ export class Membership {
|
||||||
async update(id, data) {
|
async update(id, data) {
|
||||||
try {
|
try {
|
||||||
const response = await http.put('/users/' + id).send(data);
|
const response = await http.put('/users/' + id).send(data);
|
||||||
console.log(response, 'Data user')
|
this.ctx.authentication.userData.role === "Admin"
|
||||||
console.log(JSON.stringify(response.body.data), 'Data')
|
? await this.ctx.membership.getData()
|
||||||
|
: await this.ctx.membership.getDataBySuperior();
|
||||||
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -66,11 +72,14 @@ export class Membership {
|
||||||
|
|
||||||
async delete(id) {
|
async delete(id) {
|
||||||
try {
|
try {
|
||||||
return await http.del('/users/' + id);
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async changeStatus(id, status) {
|
async changeStatus(id, status) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user