|
|
@ -30,7 +30,16 @@ export const videoMagnetsAtom = atomWithQuery((get) => { |
|
|
|
return { |
|
|
|
queryKey: [ 'videoMagnets', get(videoMagnetSearchAtom) ], |
|
|
|
queryFn: async ({ queryKey: [ , params ] }) => { |
|
|
|
return await cmsServ.videoMagnet.list(params as SearchParams) |
|
|
|
const p = {} as SearchParams |
|
|
|
Object.keys(params as any).forEach(key=>{ |
|
|
|
const value =(params as any)[key] |
|
|
|
if (Array.isArray(value)) { |
|
|
|
p[key] = value.join(',') |
|
|
|
} else { |
|
|
|
p[key] = value |
|
|
|
} |
|
|
|
}) |
|
|
|
return await cmsServ.videoMagnet.list(p) |
|
|
|
}, |
|
|
|
select: res => { |
|
|
|
const data = res.data |
|
|
|