Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/api/sets/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { Database } from "@/integrations/supabase/types";
import type { Artist } from "@/api/artists/types";
import { asEnumValue } from "@/lib/enum";

export const SET_TYPES = ["music", "workshop", "performance", "other"] as const;

export type SetType = (typeof SET_TYPES)[number];

export function asSetType(value: string | null): SetType | null {
return asEnumValue(SET_TYPES, value);
}
import {
SET_TYPES,
asSetType,
type SetType,
} from "@functions/_shared/setTypes.ts";

export { SET_TYPES, asSetType };
export type { SetType };

export function isNonMusicSetType(
setType: SetType | null,
Expand Down
4 changes: 2 additions & 2 deletions supabase/functions/_shared/setTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Mirrors SET_TYPES in src/api/sets/types.ts and the sets_set_type_check
* constraint. Keep the three in sync when adding a type.
* Single TypeScript definition of set types: src/api/sets/types.ts re-exports
* it, so this file must stay dependency-free (Deno can't resolve `@/` aliases).
*/
export const SET_TYPES = ["music", "workshop", "performance", "other"] as const;

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@functions/*": ["./supabase/functions/*"]
}
},
"include": ["src"]
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./src/*"],
"@functions/*": ["./supabase/functions/*"]
},
"skipLibCheck": true,
"allowJs": true,
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default defineConfig(({ mode }) => ({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@functions": path.resolve(__dirname, "./supabase/functions"),
},
},
}));
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@functions": path.resolve(__dirname, "./supabase/functions"),
},
},
});
1 change: 1 addition & 0 deletions vitest.integration.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@functions": path.resolve(__dirname, "./supabase/functions"),
},
},
});
Loading