mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-28 20:04:26 +00:00
refactor(authz): move to domain-based authz and flatten routes
This commit is contained in:
@@ -108,8 +108,8 @@ export function SearchFilterDialog({
|
||||
}
|
||||
if (!name) name = 'Untitled Collection'
|
||||
|
||||
const res = await client.api.teams[':teamId'].projects[':projectId'].collections.$post({
|
||||
param: { teamId, projectId },
|
||||
const res = await client.api.projects[':projectId'].collections.$post({
|
||||
param: { projectId },
|
||||
json: {
|
||||
name,
|
||||
filter: {
|
||||
@@ -125,7 +125,7 @@ export function SearchFilterDialog({
|
||||
return await res.json()
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['collections', teamId, projectId] })
|
||||
queryClient.invalidateQueries({ queryKey: ['collections', projectId] })
|
||||
toast.success('Collection saved')
|
||||
onOpenChange(false)
|
||||
navigate({
|
||||
@@ -141,8 +141,8 @@ export function SearchFilterDialog({
|
||||
const { data: searchResults, isLoading } = useQuery({
|
||||
queryKey: ['search-preview', teamId, assetId, combinedConditions],
|
||||
queryFn: async () => {
|
||||
const res = await client.api.teams[':teamId'].folders[':folderId'].search.$post({
|
||||
param: { teamId, folderId: assetId },
|
||||
const res = await client.api.folders[':folderId'].search.$post({
|
||||
param: { folderId: assetId },
|
||||
json: {
|
||||
assetType: undefined,
|
||||
conditions: combinedConditions,
|
||||
|
||||
Reference in New Issue
Block a user