feat: use tz_offset when doing deployment dau query (#7736)

* Have FE query correct tz_offset data
This commit is contained in:
Steven Masley
2023-06-01 09:23:50 -04:00
committed by GitHub
parent 555ea64669
commit cf8d2bc096
4 changed files with 12 additions and 7 deletions
+5 -2
View File
@@ -831,8 +831,11 @@ export const getTemplateDAUs = async (
return response.data
}
export const getDeploymentDAUs = async (): Promise<TypesGen.DAUsResponse> => {
const response = await axios.get(`/api/v2/insights/daus`)
export const getDeploymentDAUs = async (
// Default to user's local timezone
offset = new Date().getTimezoneOffset() / 60,
): Promise<TypesGen.DAUsResponse> => {
const response = await axios.get(`/api/v2/insights/daus?tz_offset=${offset}`)
return response.data
}
@@ -64,7 +64,9 @@ export const deploymentConfigMachine = createMachine(
{
services: {
getDeploymentValues: getDeploymentValues,
getDeploymentDAUs: getDeploymentDAUs,
getDeploymentDAUs: async () => {
return getDeploymentDAUs()
},
},
actions: {
assignDeploymentValues: assign({