Refech code after code update (#9577)
- fixes code step update, then close code step, then open code step, code not up to date
This commit is contained in:
@ -9,6 +9,8 @@ import {
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { FIND_ONE_SERVERLESS_FUNCTION } from '@/settings/serverless-functions/graphql/queries/findOneServerlessFunction';
|
import { FIND_ONE_SERVERLESS_FUNCTION } from '@/settings/serverless-functions/graphql/queries/findOneServerlessFunction';
|
||||||
import { sleep } from '~/utils/sleep';
|
import { sleep } from '~/utils/sleep';
|
||||||
|
import { getOperationName } from '@apollo/client/utilities';
|
||||||
|
import { FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE } from '@/settings/serverless-functions/graphql/queries/findOneServerlessFunctionSourceCode';
|
||||||
|
|
||||||
export const useUpdateOneServerlessFunction = (
|
export const useUpdateOneServerlessFunction = (
|
||||||
serverlessFunctionId: string,
|
serverlessFunctionId: string,
|
||||||
@ -29,6 +31,9 @@ export const useUpdateOneServerlessFunction = (
|
|||||||
variables: {
|
variables: {
|
||||||
input: { ...input, id: serverlessFunctionId },
|
input: { ...input, id: serverlessFunctionId },
|
||||||
},
|
},
|
||||||
|
refetchQueries: [
|
||||||
|
getOperationName(FIND_ONE_SERVERLESS_FUNCTION_SOURCE_CODE) ?? '',
|
||||||
|
],
|
||||||
});
|
});
|
||||||
setIsReady(false);
|
setIsReady(false);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user