Merge pull request 'Fix some issues' (#6) from ajanin into cicd
All checks were successful
Build and Push to Registry / build-and-push (push) Successful in 3m52s

Reviewed-on: #6
This commit is contained in:
ajanin 2025-07-10 06:30:18 +00:00
commit 1a397a8a5d
4 changed files with 11 additions and 16 deletions

View File

@ -36,14 +36,14 @@ export default function DefaultCollaboratorDashboard(props: IProps) {
*/
const user: any = UserStore.instance.getUser();
const officeUid: string = user.office.uid;
const officeId: string = user.office.uid;
CollaboratorService.getCollaborators().then((processes: any[]) => {
if (processes.length > 0) {
let collaborators: any[] = processes.map((process: any) => process.processData);
// FilterBy office.uid
collaborators = collaborators.filter((collaborator: any) => collaborator.office.uid === officeUid);
collaborators = collaborators.filter((collaborator: any) => collaborator.office.uid === officeId);
setCollaborators(collaborators);
}

View File

@ -7,6 +7,7 @@ import JwtService from "@Front/Services/JwtService/JwtService";
import { DocumentType } from "le-coffre-resources/dist/Notary";
import DocumentTypeService from "src/common/Api/LeCoffreApi/sdk/DocumentTypeService";
import UserStore from "@Front/Stores/UserStore";
type IProps = IPropsDashboardWithList;
@ -15,11 +16,8 @@ export default function DefaultDocumentTypeDashboard(props: IProps) {
const router = useRouter();
const { documentTypeUid } = router.query;
useEffect(() => {
const jwt = JwtService.getInstance().decodeJwt();
if (!jwt) return;
// TODO: review
const officeId = 'demo_notary_office_id'; // jwt.office_Id;
const user: any = UserStore.instance.getUser();
const officeId: string = user.office.uid;
DocumentTypeService.getDocumentTypes().then((processes: any[]) => {
if (processes.length > 0) {

View File

@ -16,6 +16,7 @@ import classes from "./classes.module.scss";
import DocumentTypeService from "src/common/Api/LeCoffreApi/sdk/DocumentTypeService";
import LoaderService from "src/common/Api/LeCoffreApi/sdk/Loader/LoaderService";
import UserStore from "@Front/Stores/UserStore";
type IProps = {};
export default function DocumentTypesCreate(props: IProps) {
@ -25,11 +26,8 @@ export default function DocumentTypesCreate(props: IProps) {
const onSubmitHandler = useCallback(
async (e: React.FormEvent<HTMLFormElement> | null, values: { [key: string]: string }) => {
try {
const jwt = JwtService.getInstance().decodeJwt();
if (!jwt) return;
// TODO: review
const officeId = 'demo_notary_office_id'; // jwt.office_Id;
const user: any = UserStore.instance.getUser();
const officeId: string = user.office.uid;
const documentFormModel = DocumentType.hydrate<DocumentType>({
...values,

View File

@ -19,6 +19,7 @@ import { ValidationError } from "class-validator";
import RoleService from "src/common/Api/LeCoffreApi/sdk/RoleService";
import LoaderService from "src/common/Api/LeCoffreApi/sdk/Loader/LoaderService";
import UserStore from "@Front/Stores/UserStore";
type IProps = {};
export default function RolesCreate(props: IProps) {
@ -29,10 +30,8 @@ export default function RolesCreate(props: IProps) {
const router = useRouter();
const onSubmitHandler = useCallback(
async (e: React.FormEvent<HTMLFormElement> | null, values: { [key: string]: string }) => {
const jwt = JwtService.getInstance().decodeJwt();
// TODO: review
const officeId = 'demo_notary_office_id'; //jwt?.office_Id;
const user: any = UserStore.instance.getUser();
const officeId: string = user.office.uid;
const officeRole = OfficeRole.hydrate<OfficeRole>({
name: values["name"],