edit path 40

This commit is contained in:
kittapath 2024-10-28 11:48:00 +07:00
parent 6f098ef6c2
commit 5207572da1

View file

@ -39,7 +39,7 @@ import {
commandTypePath,
removeProfileInOrganize,
setLogDataDiff,
checkCommandType
checkCommandType,
} from "../interfaces/utils";
import { Position } from "../entities/Position";
import { PosMaster } from "../entities/PosMaster";
@ -1828,8 +1828,8 @@ export class CommandController extends Controller {
await removeProfileInOrganize(profile.id, "OFFICER");
}
const clearProfile = await checkCommandType(String(item.commandId));
if(clearProfile) {
if(profile.keycloak != null) {
if (clearProfile) {
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) profile.keycloak = _null;
}
@ -1918,8 +1918,8 @@ export class CommandController extends Controller {
await removeProfileInOrganize(profile.id, "EMPLOYEE");
}
const clearProfile = await checkCommandType(String(item.commandId));
if(clearProfile) {
if(profile.keycloak != null) {
if (clearProfile) {
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) profile.keycloak = _null;
}
@ -1983,15 +1983,15 @@ export class CommandController extends Controller {
};
const clearProfile = await checkCommandType(String(item.commandId));
const _null: any = null;
if(clearProfile) {
if(profile.keycloak != null) {
if (clearProfile) {
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) profile.keycloak = _null;
}
profile.position = _null;
profile.posTypeId = _null;
profile.posLevelId = _null;
await this.profileRepository.save(profile, {data: req});
await this.profileRepository.save(profile, { data: req });
}
Object.assign(data, { ...item, ...meta });
const history = new ProfileSalaryHistory();
@ -2189,8 +2189,8 @@ export class CommandController extends Controller {
await removeProfileInOrganize(profile.id, "OFFICER");
}
const clearProfile = await checkCommandType(String(item.commandId));
if(clearProfile) {
if(profile.keycloak != null) {
if (clearProfile) {
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) profile.keycloak = _null;
}
@ -2372,8 +2372,8 @@ export class CommandController extends Controller {
});
const clearProfile = await checkCommandType(String(item.commandId));
const _null: any = null;
if(clearProfile) {
if(_profile.keycloak != null) {
if (clearProfile) {
if (_profile.keycloak != null) {
const delUserKeycloak = await deleteUser(_profile.keycloak);
if (delUserKeycloak) _profile.keycloak = _null;
}
@ -2809,7 +2809,7 @@ export class CommandController extends Controller {
await this.posMasterActRepository.save(data);
return new HttpSuccess();
}
@Post("command40/officer/delete")
@Post("command40/officer/report/delete")
public async command40SalaryOfficerDelete(
@Request() req: RequestWithUser,
@Body()