Fix build errors: add missing stub exports and fix implicit any types
- Add getApprovalWorkflowsByEntities to approval.workflows.be.ts stub - Add filterAllowedUsers to users.be.ts stub - Make convertToUsers synchronous in groups.be.ts stub - Remove unused import of deleted API route in entities/[id]/index.tsx - Fix implicit any type errors in approval-workflows, entities, permissions pages Made-with: Cursor
This commit is contained in:
@@ -76,8 +76,8 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res }) => {
|
||||
const allAssigneeIds: string[] = [
|
||||
...new Set(
|
||||
workflows
|
||||
.map(workflow => workflow.steps
|
||||
.map(step => step.assignees)
|
||||
.map((workflow: any) => workflow.steps
|
||||
.map((step: any) => step.assignees)
|
||||
.flat()
|
||||
).flat()
|
||||
)
|
||||
|
||||
@@ -47,8 +47,6 @@ import {
|
||||
BsX,
|
||||
} from "react-icons/bs";
|
||||
import { toast } from "react-toastify";
|
||||
import entities from "../../api/entities";
|
||||
|
||||
const expirationDateColor = (date: Date) => {
|
||||
const momentDate = moment(date);
|
||||
const today = moment(new Date());
|
||||
@@ -120,7 +118,7 @@ export const getServerSideProps = withIronSessionSsr(
|
||||
]);
|
||||
|
||||
const usersWithRole = entityUsers.map((u) => {
|
||||
const e = u?.entities?.find((e) => e.id === id);
|
||||
const e = u?.entities?.find((e: any) => e.id === id);
|
||||
return { ...u, role: findBy(entity.roles, "id", e?.role) };
|
||||
});
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ export const getServerSideProps = withIronSessionSsr(
|
||||
// const permissions: Permission[] = await res.json();
|
||||
// Pass data to the page via props
|
||||
const usersData: BasicUser[] = permission.users.reduce(
|
||||
(acc: BasicUser[], userId) => {
|
||||
(acc: BasicUser[], userId: any) => {
|
||||
const user = filteredUsers.find((u) => u.id === userId) as BasicUser;
|
||||
if (!!user) acc.push(user);
|
||||
return acc;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
export async function getApprovalWorkflows(..._args: any[]): Promise<any[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
export async function getApprovalWorkflow(..._args: any[]): Promise<any> {
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function getApprovalWorkflowsByEntities(..._args: any[]): Promise<any[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ export async function getParticipantsGroups(..._args: any[]): Promise<any[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
export async function convertToUsers(..._args: any[]): Promise<any[]> {
|
||||
return [];
|
||||
export function convertToUsers(..._args: any[]): any {
|
||||
return _args[0] || {};
|
||||
}
|
||||
|
||||
export async function getGroupsForEntities(..._args: any[]): Promise<any[]> {
|
||||
|
||||
@@ -37,3 +37,7 @@ export async function countUsersByTypes(..._args: any[]): Promise<number> {
|
||||
export async function countAllowedUsers(..._args: any[]): Promise<number> {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function filterAllowedUsers(..._args: any[]): any[] {
|
||||
return _args[0] || [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user