add parth admin ability
This commit is contained in:
parent
aa129dce2f
commit
7fc4d4c4f0
3 changed files with 32 additions and 5 deletions
|
|
@ -66,7 +66,6 @@ export class ProfileAbilityController extends Controller {
|
|||
@Path() abilityId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
||||
const _record = await this.profileAbilityRepo.findOne({
|
||||
where: { id: abilityId },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
return new HttpSuccess(getProfileAbilityId);
|
||||
}
|
||||
|
||||
@Get("history/{abilityId}")
|
||||
public async getProfileAbilityHistory(
|
||||
@Get("admin/history/{abilityId}")
|
||||
public async getProfileAdminAbilityHistory(
|
||||
@Path() abilityId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -87,6 +87,20 @@ export class ProfileAbilityEmployeeController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{abilityId}")
|
||||
public async getProfileAbilityHistory(
|
||||
@Path() abilityId: string,
|
||||
) {
|
||||
const record = await this.profileAbilityHistoryRepo.find({
|
||||
where: { profileAbilityId: abilityId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newProfileAbility(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export class ProfileAbilityEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(getProfileAbilityId);
|
||||
}
|
||||
|
||||
@Get("history/{abilityId}")
|
||||
public async getProfileAbilityHistory(
|
||||
@Get("admin/history/{abilityId}")
|
||||
public async getProfileAdminAbilityHistory(
|
||||
@Path() abilityId: string,
|
||||
@Request() req: RequestWithUser,
|
||||
) {
|
||||
|
|
@ -83,6 +83,20 @@ export class ProfileAbilityEmployeeTempController extends Controller {
|
|||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Get("history/{abilityId}")
|
||||
public async getProfileAbilityHistory(
|
||||
@Path() abilityId: string,
|
||||
) {
|
||||
const record = await this.profileAbilityHistoryRepo.find({
|
||||
where: { profileAbilityId: abilityId },
|
||||
order: { createdAt: "DESC" },
|
||||
});
|
||||
if (!record) {
|
||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||
}
|
||||
return new HttpSuccess(record);
|
||||
}
|
||||
|
||||
@Post()
|
||||
public async newProfileAbility(
|
||||
@Request() req: RequestWithUser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue