mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: use tz_offset when doing deployment dau query (#7736)
* Have FE query correct tz_offset data
This commit is contained in:
+5
-2
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user