Skip to content

Commit 20b5eac

Browse files
committed
fix: do not send "me" when querying operation sets
1 parent ebf83cb commit 20b5eac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/apis/operation-set.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useAtomValue } from 'jotai'
12
import { noop } from 'lodash-es'
23
import {
34
CopilotSetPageRes,
@@ -12,6 +13,7 @@ import { OperationSetApi } from 'utils/maa-copilot-client'
1213
import { useSWRRefresh } from 'utils/swr'
1314

1415
import { parseShortCode } from '../models/shortCode'
16+
import { authAtom } from '../store/auth'
1517

1618
export type OrderBy = 'views' | 'hot' | 'id'
1719

@@ -29,6 +31,7 @@ export function useOperationSets({
2931
disabled,
3032
suspense,
3133
}: UseOperationSetsParams) {
34+
const auth = useAtomValue(authAtom)
3235
const {
3336
data: pages,
3437
error,
@@ -49,7 +52,7 @@ export function useOperationSets({
4952
limit: 50,
5053
page: pageIndex + 1,
5154
keyword,
52-
creatorId,
55+
creatorId: creatorId === 'me' ? auth.userId : creatorId,
5356
} satisfies CopilotSetQuery,
5457
]
5558
},

0 commit comments

Comments
 (0)