Merge branch 'feat/model-plugins-implementing' into deploy/dev

# Conflicts:
#	web/app/components/header/account-setting/model-provider-page/model-parameter-modal/presets-parameter.tsx
#	web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.tsx
This commit is contained in:
yyh
2026-03-11 17:27:10 +08:00
30 changed files with 750 additions and 453 deletions

View File

@ -234,6 +234,24 @@ describe('getMarketplacePluginsByCollectionId', () => {
expect(result).toEqual([])
})
it('should send an empty body when query is omitted', async () => {
mockCollectionPlugins.mockResolvedValueOnce({
data: { plugins: [] },
})
const { getMarketplacePluginsByCollectionId } = await import('../utils')
await getMarketplacePluginsByCollectionId('test-collection')
expect(mockCollectionPlugins).toHaveBeenCalledWith({
params: {
collectionId: 'test-collection',
},
body: {},
}, expect.objectContaining({
signal: undefined,
}))
})
it('should pass abort signal when provided', async () => {
const mockPlugins = [{ type: 'plugin', org: 'test', name: 'plugin1' }]
mockCollectionPlugins.mockResolvedValueOnce({

View File

@ -63,7 +63,7 @@ export const getMarketplacePluginsByCollectionId = async (
params: {
collectionId,
},
body: query,
body: query ?? {},
}, {
signal: options?.signal,
})