-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem with RTK query code generation
- Loading branch information
1 parent
3e2a0e5
commit 890fa7b
Showing
2 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
assets/js/src/core/modules/user/user-api-slice-enhanced.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - Pimcore Open Core License (POCL) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL | ||
*/ | ||
|
||
import { api as baseApi } from './user-api-slice.gen' | ||
|
||
const api = baseApi.enhanceEndpoints({ | ||
endpoints: { | ||
userUploadImage: { | ||
query: (queryArg) => { | ||
const formData = new FormData() | ||
formData.append('userImage', queryArg.body.userImage) | ||
return { | ||
url: `/pimcore-studio/api/user/upload-image/${queryArg.id}`, | ||
method: 'POST', | ||
body: formData | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
|
||
export type * from './user-api-slice.gen' | ||
|
||
export const { | ||
useUserCloneByIdMutation, | ||
useUserCreateMutation, | ||
useUserFolderCreateMutation, | ||
useUserGetCurrentInformationQuery, | ||
useUserGetByIdQuery, | ||
useUserUpdateByIdMutation, | ||
useUserDeleteByIdMutation, | ||
useUserFolderDeleteByIdMutation, | ||
useUserDefaultKeyBindingsQuery, | ||
useUserGetAvailablePermissionsQuery, | ||
useUserGetCollectionQuery, | ||
useUserResetPasswordMutation, | ||
usePimcoreStudioApiUserSearchQuery, | ||
useUserUpdatePasswordByIdMutation, | ||
useUserUploadImageMutation, | ||
useUserGetImageQuery, | ||
useUserGetTreeQuery | ||
} = api | ||
|
||
export { api } |