fix: refresh api-based-extension (#1464)

This commit is contained in:
zxhlyh 2023-11-06 20:29:41 +08:00 committed by GitHub
parent 279f099ba0
commit 13b64bc55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ const Empty = () => {
<div className='flex items-center justify-center mb-3 w-12 h-12 rounded-[10px] border border-[#EAECF5]'> <div className='flex items-center justify-center mb-3 w-12 h-12 rounded-[10px] border border-[#EAECF5]'>
<Webhooks className='w-6 h-6 text-gray-500' /> <Webhooks className='w-6 h-6 text-gray-500' />
</div> </div>
<div className='mb-2 text-sm text-gray-600'>{t('commosn.apiBasedExtension.title')}</div> <div className='mb-2 text-sm text-gray-600'>{t('common.apiBasedExtension.title')}</div>
<a <a
className='flex items-center mb-2 h-[18px] text-xs text-primary-600' className='flex items-center mb-2 h-[18px] text-xs text-primary-600'
href={t('common.apiBasedExtension.linkUrl') || '/'} href={t('common.apiBasedExtension.linkUrl') || '/'}

View File

@ -30,7 +30,7 @@ const ApiBasedExtensionSelector: FC<ApiBasedExtensionSelectorProps> = ({
setShowAccountSettingModal, setShowAccountSettingModal,
setShowApiBasedExtensionModal, setShowApiBasedExtensionModal,
} = useModalContext() } = useModalContext()
const { data } = useSWR( const { data, mutate } = useSWR(
'/api-based-extension', '/api-based-extension',
fetchApiBasedExtensionList, fetchApiBasedExtensionList,
) )
@ -104,7 +104,7 @@ const ApiBasedExtensionSelector: FC<ApiBasedExtensionSelectorProps> = ({
<div className='p-1'> <div className='p-1'>
<div <div
className='flex items-center px-3 h-8 text-sm text-primary-600 cursor-pointer' className='flex items-center px-3 h-8 text-sm text-primary-600 cursor-pointer'
onClick={() => setShowApiBasedExtensionModal({ payload: {} })} onClick={() => setShowApiBasedExtensionModal({ payload: {}, onSaveCallback: () => mutate() })}
> >
<Plus className='mr-2 w-4 h-4' /> <Plus className='mr-2 w-4 h-4' />
{t('common.operation.add')} {t('common.operation.add')}