feat: promise safety with eslint

This commit is contained in:
Mythie
2023-08-29 13:01:19 +10:00
parent ba054ae915
commit ca40e983e3
35 changed files with 103 additions and 57 deletions

View File

@ -32,7 +32,7 @@ export const getFlag = async (
revalidate: 60,
},
})
.then((res) => res.json())
.then(async (res) => res.json())
.then((res) => ZFeatureFlagValueSchema.parse(res))
.catch(() => false);
@ -64,7 +64,7 @@ export const getAllFlags = async (
revalidate: 60,
},
})
.then((res) => res.json())
.then(async (res) => res.json())
.then((res) => z.record(z.string(), ZFeatureFlagValueSchema).parse(res))
.catch(() => LOCAL_FEATURE_FLAGS);
};

View File

@ -11,6 +11,6 @@ export default function PostHogServerClient() {
return new PostHog(postHogConfig.key, {
host: postHogConfig.host,
fetch: (...args) => fetch(...args),
fetch: async (...args) => fetch(...args),
});
}