feat(feature-flags): fixes #1592, introduces new flags DISABLE_SIGNUPS and DISABLE_EMAIL_AUTH, renamed STORAGE_SKIP_BUCKET_CHECK

This commit is contained in:
Amruth Pillai
2024-05-29 10:30:38 +02:00
parent 1191bbca67
commit d18ef2e1a5
23 changed files with 1697 additions and 1366 deletions

View 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 };
};

View File

@ -0,0 +1 @@
export * from "./flags";