Fix a mutation that should have been a query

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-06-28 09:36:29 +02:00
parent b2a40d15fa
commit 98b8b3338c
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 4 additions and 4 deletions

View file

@ -158,7 +158,7 @@ export const PRIVACY = gql`
`; `;
export const TIMEZONES = gql` export const TIMEZONES = gql`
query { query Timezones {
config { config {
timezones timezones
} }
@ -166,7 +166,7 @@ export const TIMEZONES = gql`
`; `;
export const WEB_PUSH = gql` export const WEB_PUSH = gql`
query { query WebPush {
config { config {
webPush { webPush {
enabled enabled

View file

@ -22,8 +22,8 @@ export async function subscribeUserToPush(): Promise<PushSubscription | null> {
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>; apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
const registration = await navigator.serviceWorker.ready; const registration = await navigator.serviceWorker.ready;
const { data } = await client.mutate<{ config: IConfig }>({ const { data } = await client.query<{ config: IConfig }>({
mutation: WEB_PUSH, query: WEB_PUSH,
}); });
if (data?.config?.webPush?.enabled && data?.config?.webPush?.publicKey) { if (data?.config?.webPush?.enabled && data?.config?.webPush?.publicKey) {