File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import type { AxiosInstance } from 'axios'
2-
31import { bindCredentialsApi } from './credentials'
2+ import type { DeduplicatedClient } from './deduplicatedClient'
43
54const mockClient = {
65 get : jest . fn ( ) ,
76 post : jest . fn ( ) ,
8- put : jest . fn ( )
9- } as unknown as jest . Mocked < AxiosInstance >
7+ put : jest . fn ( ) ,
8+ clearCache : jest . fn ( )
9+ } as unknown as jest . Mocked < DeduplicatedClient >
1010
1111beforeEach ( ( ) => {
1212 jest . clearAllMocks ( )
Original file line number Diff line number Diff line change 1- import type { AxiosInstance } from 'axios'
2-
31import type { ComponentCredentialSchema , CreateCredentialBody , Credential } from '@/core/types'
42
3+ import type { DeduplicatedClient } from './deduplicatedClient'
4+
55/**
66 * Create credentials API functions bound to a client instance
77 */
8- export function bindCredentialsApi ( client : AxiosInstance ) {
8+ export function bindCredentialsApi ( client : DeduplicatedClient ) {
99 return {
1010 /**
1111 * Get all credentials
@@ -36,6 +36,7 @@ export function bindCredentialsApi(client: AxiosInstance) {
3636 */
3737 createCredential : async ( body : CreateCredentialBody ) : Promise < Credential > => {
3838 const response = await client . post ( '/credentials' , body )
39+ client . clearCache ( )
3940 return response . data
4041 } ,
4142
@@ -52,6 +53,7 @@ export function bindCredentialsApi(client: AxiosInstance) {
5253 */
5354 updateCredential : async ( id : string , body : CreateCredentialBody ) : Promise < Credential > => {
5455 const response = await client . put ( `/credentials/${ id } ` , body )
56+ client . clearCache ( )
5557 return response . data
5658 }
5759 }
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export default defineConfig(({ mode }) => {
4646 'react/jsx-runtime' : 'jsxRuntime' ,
4747 '@mui/material' : 'MaterialUI' ,
4848 '@mui/material/styles' : 'MaterialUIStyles' ,
49+ '@mui/icons-material' : 'MaterialUIIcons' ,
4950 '@emotion/react' : 'emotionReact' ,
5051 '@emotion/styled' : 'emotionStyled' ,
5152 reactflow : 'ReactFlow'
You can’t perform that action at this time.
0 commit comments