mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-25 06:01:29 +10:00
feat(feature-flags): fixes #1592, introduces new flags DISABLE_SIGNUPS and DISABLE_EMAIL_AUTH, renamed STORAGE_SKIP_BUCKET_CHECK
This commit is contained in:
28
apps/client/src/services/feature/flags.ts
Normal file
28
apps/client/src/services/feature/flags.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { FeatureDto } from "@reactive-resume/dto";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { axios } from "@/client/libs/axios";
|
||||
|
||||
export const fetchFeatureFlags = async () => {
|
||||
const response = await axios.get<FeatureDto>(`/feature/flags`);
|
||||
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const useFeatureFlags = () => {
|
||||
const {
|
||||
error,
|
||||
isPending: loading,
|
||||
data: flags,
|
||||
} = useQuery({
|
||||
queryKey: ["feature_flags"],
|
||||
queryFn: () => fetchFeatureFlags(),
|
||||
refetchOnMount: "always",
|
||||
initialData: {
|
||||
isSignupsDisabled: false,
|
||||
isEmailAuthDisabled: false,
|
||||
},
|
||||
});
|
||||
|
||||
return { flags, loading, error };
|
||||
};
|
||||
1
apps/client/src/services/feature/index.ts
Normal file
1
apps/client/src/services/feature/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./flags";
|
||||
Reference in New Issue
Block a user