Skip to content

Commit

Permalink
add support for order index (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
chribjel authored Nov 12, 2024
1 parent ee8cde3 commit d2d9ef8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ export interface IConfig {
}

const defaultConfig: IConfig = {
clientId: "3e09bdb6-734c-473e-ab69-1238057dfc5d",
clientId:
import.meta.env.VITE_CLIENT_ID ?? "3e09bdb6-734c-473e-ab69-1238057dfc5d",
authority:
import.meta.env.VITE_AUTHORITY ??
"https://login.microsoftonline.com/7531b79e-fd42-4826-bff2-131d82c7b557/v2.0",
redirect_uri: "http://localhost:5173",
backend_url: "https://frisk-backend.fly.dev",
redirect_uri:
import.meta.env.VITE_LOGIN_REDIRECT_URI ?? "http://localhost:5173",
backend_url:
import.meta.env.VITE_BACKEND_URL ?? "https://frisk-backend.fly.dev",
regelrett_frontend_url:
import.meta.env.VITE_REGLERRETT_FRONTEND_URL ??
"https://regelrett-frontend-1024826672490.europe-north1.run.app",
};

Expand Down
1 change: 1 addition & 0 deletions src/hooks/use-function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function useFunction(functionId: number, opts?: UseFunctionOpts) {
..._newFunction.function,
id: randomNegativeNumber,
path: `${func.data?.path}.${randomNegativeNumber}`,
orderIndex: 999,
};
await queryClient.cancelQueries({
queryKey: ["functions", newFunction.parentId, "children"],
Expand Down
6 changes: 5 additions & 1 deletion src/services/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ const BackendFunction = object({
description: string().nullable(),
path: string(),
parentId: number().int().nullable(),
orderIndex: number().int(),
});
export type BackendFunction = z.infer<typeof BackendFunction>;
type BackendFunctionCreate = Omit<BackendFunction, "id" | "path">;
type BackendFunctionCreate = Omit<
BackendFunction,
"id" | "path" | "orderIndex"
>;
export type BackendFunctionWithMetadataCreate = {
function: BackendFunctionCreate;
metadata: Omit<FunctionMetadataCreate, "functionId">[];
Expand Down

0 comments on commit d2d9ef8

Please sign in to comment.