Merge branch 'develop'
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 3s
This commit is contained in:
commit
893eb4cca5
4 changed files with 7 additions and 2 deletions
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "RequestWorkStepStatus" ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
@ -1612,6 +1612,7 @@ model RequestWork {
|
||||||
model RequestWorkStepStatus {
|
model RequestWorkStepStatus {
|
||||||
step Int
|
step Int
|
||||||
workStatus RequestWorkStatus @default(Pending)
|
workStatus RequestWorkStatus @default(Pending)
|
||||||
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
|
|
||||||
requestWork RequestWork @relation(fields: [requestWorkId], references: [id], onDelete: Cascade)
|
requestWork RequestWork @relation(fields: [requestWorkId], references: [id], onDelete: Cascade)
|
||||||
requestWorkId String
|
requestWorkId String
|
||||||
|
|
|
||||||
|
|
@ -623,7 +623,7 @@ export class CustomerBranchFileController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!data) throw notFoundError("Customer Branch");
|
if (!data) throw notFoundError("Customer Branch");
|
||||||
await permissionCheck(user, data.customer.registeredBranch);
|
await permissionCheckCompany(user, data.customer.registeredBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("attachment")
|
@Get("attachment")
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,9 @@ function globalAllow(user: RequestWithUser["user"]) {
|
||||||
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
return user.roles?.some((v) => listAllowed.includes(v)) || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const permissionCondCompany = createPermCondition((_) => true);
|
||||||
const permissionCond = createPermCondition(globalAllow);
|
const permissionCond = createPermCondition(globalAllow);
|
||||||
|
const permissionCheckCompany = createPermCheck((_) => true);
|
||||||
const permissionCheck = createPermCheck(globalAllow);
|
const permissionCheck = createPermCheck(globalAllow);
|
||||||
|
|
||||||
type EmployeeCreate = {
|
type EmployeeCreate = {
|
||||||
|
|
@ -669,7 +671,7 @@ export class EmployeeFileController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!data) throw notFoundError("Employee");
|
if (!data) throw notFoundError("Employee");
|
||||||
await permissionCheck(user, data.customerBranch.customer.registeredBranch);
|
await permissionCheckCompany(user, data.customerBranch.customer.registeredBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("image")
|
@Get("image")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue