Browse Source

chore(web): generate API functions with a single argument (#2568)

Sergey Kondrikov 2 years ago
parent
commit
6c6c5ef651
65 changed files with 1218 additions and 357 deletions
  1. 1 1
      server/bin/generate-open-api.sh
  2. 935 138
      web/src/api/open-api/api.ts
  3. 3 3
      web/src/api/utils.ts
  4. 1 1
      web/src/lib/components/admin-page/delete-confirm-dialoge.svelte
  5. 1 1
      web/src/lib/components/admin-page/jobs/jobs-panel.svelte
  6. 1 1
      web/src/lib/components/admin-page/restore-dialoge.svelte
  7. 4 2
      web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte
  8. 4 2
      web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte
  9. 4 2
      web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte
  10. 4 2
      web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte
  11. 4 3
      web/src/lib/components/album-page/__tests__/album-card.spec.ts
  12. 5 4
      web/src/lib/components/album-page/album-card.svelte
  13. 23 17
      web/src/lib/components/album-page/album-viewer.svelte
  14. 1 1
      web/src/lib/components/album-page/share-info-modal.svelte
  15. 1 1
      web/src/lib/components/album-page/user-selection-modal.svelte
  16. 31 18
      web/src/lib/components/asset-viewer/asset-viewer.svelte
  17. 6 3
      web/src/lib/components/asset-viewer/detail-panel.svelte
  18. 6 3
      web/src/lib/components/asset-viewer/photo-viewer.svelte
  19. 6 4
      web/src/lib/components/forms/admin-registration-form.svelte
  20. 5 3
      web/src/lib/components/forms/change-password-form.svelte
  21. 6 4
      web/src/lib/components/forms/create-user-form.svelte
  22. 12 8
      web/src/lib/components/forms/edit-user-form.svelte
  23. 4 2
      web/src/lib/components/forms/login-form.svelte
  24. 1 1
      web/src/lib/components/photos-page/actions/add-to-album.svelte
  25. 1 1
      web/src/lib/components/photos-page/actions/archive-action.svelte
  26. 3 1
      web/src/lib/components/photos-page/actions/delete-assets.svelte
  27. 1 1
      web/src/lib/components/photos-page/actions/favorite-action.svelte
  28. 5 2
      web/src/lib/components/photos-page/actions/remove-from-album.svelte
  29. 4 4
      web/src/lib/components/photos-page/actions/remove-from-shared-link.svelte
  30. 4 2
      web/src/lib/components/photos-page/asset-grid.svelte
  31. 4 4
      web/src/lib/components/share-page/individual-shared-viewer.svelte
  32. 1 1
      web/src/lib/components/shared-components/album-selection-modal.svelte
  33. 6 3
      web/src/lib/components/shared-components/circle-avatar.svelte
  34. 25 18
      web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte
  35. 1 1
      web/src/lib/components/shared-components/side-bar/side-bar.svelte
  36. 1 1
      web/src/lib/components/sharedlinks-page/shared-link-card.svelte
  37. 4 2
      web/src/lib/components/user-settings-page/change-password-settings.svelte
  38. 1 1
      web/src/lib/components/user-settings-page/device-list.svelte
  39. 2 2
      web/src/lib/components/user-settings-page/partner-selection-modal.svelte
  40. 3 3
      web/src/lib/components/user-settings-page/partner-settings.svelte
  41. 3 3
      web/src/lib/components/user-settings-page/user-api-key-list.svelte
  42. 6 4
      web/src/lib/components/user-settings-page/user-profile-settings.svelte
  43. 1 1
      web/src/lib/stores/asset-interaction.store.ts
  44. 5 3
      web/src/lib/stores/assets.store.ts
  45. 27 22
      web/src/lib/utils/asset-utils.ts
  46. 1 1
      web/src/routes/(user)/albums/[albumId]/+page.server.ts
  47. 2 2
      web/src/routes/(user)/albums/__tests__/albums.bloc.spec.ts
  48. 5 3
      web/src/routes/(user)/albums/albums.bloc.ts
  49. 1 1
      web/src/routes/(user)/archive/+page.svelte
  50. 1 1
      web/src/routes/(user)/favorites/+page.svelte
  51. 5 3
      web/src/routes/(user)/map/+page.svelte
  52. 1 1
      web/src/routes/(user)/partners/[userId]/+page.server.ts
  53. 2 2
      web/src/routes/(user)/people/[personId]/+page.server.ts
  54. 1 1
      web/src/routes/(user)/people/[personId]/+page.svelte
  55. 1 18
      web/src/routes/(user)/search/+page.server.ts
  56. 1 1
      web/src/routes/(user)/share/[key]/+page.server.ts
  57. 1 1
      web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.ts
  58. 2 2
      web/src/routes/(user)/sharing/+page.server.ts
  59. 3 1
      web/src/routes/(user)/sharing/+page.svelte
  60. 2 2
      web/src/routes/(user)/sharing/sharedlinks/+page.svelte
  61. 1 1
      web/src/routes/+page.server.ts
  62. 1 1
      web/src/routes/admin/user-management/+page.server.ts
  63. 7 7
      web/src/routes/admin/user-management/+page.svelte
  64. 2 2
      web/src/routes/auth/login/+page.server.ts
  65. 1 1
      web/src/routes/auth/register/+page.server.ts

+ 1 - 1
server/bin/generate-open-api.sh

@@ -20,7 +20,7 @@ function web {
   wget -O apiInner.mustache https://raw.githubusercontent.com/OpenAPITools/openapi-generator/v6.0.1/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache
   patch -u apiInner.mustache < apiInner.mustache.patch
   cd ../../..
-  npx --yes @openapitools/openapi-generator-cli generate -g typescript-axios -i ./immich-openapi-specs.json -o ../web/src/api/open-api -t ./openapi-generator/templates/web
+  npx --yes @openapitools/openapi-generator-cli generate -g typescript-axios -i ./immich-openapi-specs.json -o ../web/src/api/open-api -t ./openapi-generator/templates/web --additional-properties=useSingleRequestParameter=true
 }
 
 if [[ $1 == 'mobile' ]]; then

File diff suppressed because it is too large
+ 935 - 138
web/src/api/open-api/api.ts


+ 3 - 3
web/src/api/utils.ts

@@ -21,13 +21,13 @@ export const oauth = {
 	getConfig: (location: Location) => {
 		const redirectUri = location.href.split('?')[0];
 		console.log(`OAuth Redirect URI: ${redirectUri}`);
-		return api.oauthApi.generateConfig({ redirectUri });
+		return api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri } });
 	},
 	login: (location: Location) => {
-		return api.oauthApi.callback({ url: location.href });
+		return api.oauthApi.callback({ oAuthCallbackDto: { url: location.href } });
 	},
 	link: (location: Location): AxiosPromise<UserResponseDto> => {
-		return api.oauthApi.link({ url: location.href });
+		return api.oauthApi.link({ oAuthCallbackDto: { url: location.href } });
 	},
 	unlink: () => {
 		return api.oauthApi.unlink();

+ 1 - 1
web/src/lib/components/admin-page/delete-confirm-dialoge.svelte

@@ -10,7 +10,7 @@
 
 	const deleteUser = async () => {
 		try {
-			const deletedUser = await api.userApi.deleteUser(user.id);
+			const deletedUser = await api.userApi.deleteUser({ userId: user.id });
 			if (deletedUser.data.deletedAt != null) {
 				dispatch('user-delete-success');
 			} else {

+ 1 - 1
web/src/lib/components/admin-page/jobs/jobs-panel.svelte

@@ -102,7 +102,7 @@
 		const title = jobDetails[jobId]?.title;
 
 		try {
-			const { data } = await api.jobApi.sendJobCommand(jobId, jobCommand);
+			const { data } = await api.jobApi.sendJobCommand({ jobId, jobCommandDto: jobCommand });
 			jobs[jobId] = data;
 
 			switch (jobCommand.command) {

+ 1 - 1
web/src/lib/components/admin-page/restore-dialoge.svelte

@@ -8,7 +8,7 @@
 	const dispatch = createEventDispatcher();
 
 	const restoreUser = async () => {
-		const restoredUser = await api.userApi.restoreUser(user.id);
+		const restoredUser = await api.userApi.restoreUser({ userId: user.id });
 		if (restoredUser.data.deletedAt == null) dispatch('user-restore-success');
 		else dispatch('user-restore-fail');
 	};

+ 4 - 2
web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte

@@ -28,8 +28,10 @@
 			const { data: configs } = await api.systemConfigApi.getConfig();
 
 			const result = await api.systemConfigApi.updateConfig({
-				...configs,
-				ffmpeg: ffmpegConfig
+				systemConfigDto: {
+					...configs,
+					ffmpeg: ffmpegConfig
+				}
 			});
 
 			ffmpegConfig = { ...result.data.ffmpeg };

+ 4 - 2
web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte

@@ -73,8 +73,10 @@
 			}
 
 			const { data: updated } = await api.systemConfigApi.updateConfig({
-				...current,
-				oauth: oauthConfig
+				systemConfigDto: {
+					...current,
+					oauth: oauthConfig
+				}
 			});
 
 			oauthConfig = { ...updated.oauth };

+ 4 - 2
web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte

@@ -48,8 +48,10 @@
 			}
 
 			const { data: updated } = await api.systemConfigApi.updateConfig({
-				...current,
-				passwordLogin: passwordLoginConfig
+				systemConfigDto: {
+					...current,
+					passwordLogin: passwordLoginConfig
+				}
 			});
 
 			passwordLoginConfig = { ...updated.passwordLogin };

+ 4 - 2
web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte

@@ -97,8 +97,10 @@
 			const { data: currentConfig } = await api.systemConfigApi.getConfig();
 
 			const result = await api.systemConfigApi.updateConfig({
-				...currentConfig,
-				storageTemplate: storageConfig
+				systemConfigDto: {
+					...currentConfig,
+					storageTemplate: storageConfig
+				}
 			});
 
 			storageConfig.template = result.data.storageTemplate.template;

+ 4 - 3
web/src/lib/components/album-page/__tests__/album-card.spec.ts

@@ -86,9 +86,10 @@ describe('AlbumCard component', () => {
 		expect(albumImgElement).toHaveAttribute('alt', album.id);
 		expect(apiMock.assetApi.getAssetThumbnail).toHaveBeenCalledTimes(1);
 		expect(apiMock.assetApi.getAssetThumbnail).toHaveBeenCalledWith(
-			'thumbnailIdOne',
-			ThumbnailFormat.Jpeg,
-			undefined,
+			{
+				assetId: 'thumbnailIdOne',
+				format: ThumbnailFormat.Jpeg
+			},
 			{ responseType: 'blob' }
 		);
 		expect(createObjectURLMock).toHaveBeenCalledWith(thumbnailBlob);

+ 5 - 4
web/src/lib/components/album-page/album-card.svelte

@@ -36,9 +36,10 @@
 		}
 
 		const { data } = await api.assetApi.getAssetThumbnail(
-			thubmnailId,
-			ThumbnailFormat.Jpeg,
-			undefined,
+			{
+				assetId: thubmnailId,
+				format: ThumbnailFormat.Jpeg
+			},
 			{
 				responseType: 'blob'
 			}
@@ -61,7 +62,7 @@
 	});
 
 	const getAlbumOwnerInfo = async (): Promise<UserResponseDto> => {
-		const { data } = await api.userApi.getUserById(album.ownerId);
+		const { data } = await api.userApi.getUserById({ userId: album.ownerId });
 
 		return data;
 	};

+ 23 - 17
web/src/lib/components/album-page/album-viewer.svelte

@@ -124,8 +124,11 @@
 	$: {
 		if (!isEditingTitle && currentAlbumName != album.albumName && isOwned) {
 			api.albumApi
-				.updateAlbumInfo(album.id, {
-					albumName: album.albumName
+				.updateAlbumInfo({
+					id: album.id,
+					updateAlbumDto: {
+						albumName: album.albumName
+					}
 				})
 				.then(() => {
 					currentAlbumName = album.albumName;
@@ -143,13 +146,13 @@
 	const createAlbumHandler = async (event: CustomEvent) => {
 		const { assets }: { assets: AssetResponseDto[] } = event.detail;
 		try {
-			const { data } = await api.albumApi.addAssetsToAlbum(
-				album.id,
-				{
+			const { data } = await api.albumApi.addAssetsToAlbum({
+				id: album.id,
+				addAssetsDto: {
 					assetIds: assets.map((a) => a.id)
 				},
-				sharedLink?.key
-			);
+				key: sharedLink?.key
+			});
 
 			if (data.album) {
 				album = data.album;
@@ -168,8 +171,11 @@
 		const { selectedUsers }: { selectedUsers: UserResponseDto[] } = event.detail;
 
 		try {
-			const { data } = await api.albumApi.addUsersToAlbum(album.id, {
-				sharedUserIds: Array.from(selectedUsers).map((u) => u.id)
+			const { data } = await api.albumApi.addUsersToAlbum({
+				id: album.id,
+				addUsersDto: {
+					sharedUserIds: Array.from(selectedUsers).map((u) => u.id)
+				}
 			});
 
 			album = data;
@@ -193,7 +199,7 @@
 		}
 
 		try {
-			const { data } = await api.albumApi.getAlbumInfo(album.id);
+			const { data } = await api.albumApi.getAlbumInfo({ id: album.id });
 
 			album = data;
 			isShowShareInfoModal = false;
@@ -213,7 +219,7 @@
 			)
 		) {
 			try {
-				await api.albumApi.deleteAlbum(album.id);
+				await api.albumApi.deleteAlbum({ id: album.id });
 				goto(backUrl);
 			} catch (e) {
 				console.error('Error [userDeleteMenu] ', e);
@@ -241,10 +247,7 @@
 				let total = 0;
 
 				const { data, status, headers } = await api.albumApi.downloadArchive(
-					album.id,
-					undefined,
-					skip || undefined,
-					sharedLink?.key,
+					{ id: album.id, skip: skip || undefined, key: sharedLink?.key },
 					{
 						responseType: 'blob',
 						onDownloadProgress: function (progressEvent) {
@@ -311,8 +314,11 @@
 	const setAlbumThumbnailHandler = (event: CustomEvent) => {
 		const { asset }: { asset: AssetResponseDto } = event.detail;
 		try {
-			api.albumApi.updateAlbumInfo(album.id, {
-				albumThumbnailAssetId: asset.id
+			api.albumApi.updateAlbumInfo({
+				id: album.id,
+				updateAlbumDto: {
+					albumThumbnailAssetId: asset.id
+				}
 			});
 		} catch (e) {
 			console.error('Error [setAlbumThumbnailHandler] ', e);

+ 1 - 1
web/src/lib/components/album-page/share-info-modal.svelte

@@ -53,7 +53,7 @@
 	const removeUser = async (userId: string) => {
 		if (window.confirm('Do you want to remove selected user from the album?')) {
 			try {
-				await api.albumApi.removeUserFromAlbum(album.id, userId);
+				await api.albumApi.removeUserFromAlbum({ id: album.id, userId });
 				dispatch('user-deleted', { userId });
 			} catch (e) {
 				console.error('Error [share-info-modal] [removeUser]', e);

+ 1 - 1
web/src/lib/components/album-page/user-selection-modal.svelte

@@ -19,7 +19,7 @@
 	let sharedLinks: SharedLinkResponseDto[] = [];
 	onMount(async () => {
 		await getSharedLinks();
-		const { data } = await api.userApi.getAllUsers(false);
+		const { data } = await api.userApi.getAllUsers({ isAll: false });
 
 		// remove invalid users
 		users = data.filter((user) => !(user.deletedAt || user.id === album.ownerId));

+ 31 - 18
web/src/lib/components/asset-viewer/asset-viewer.svelte

@@ -65,7 +65,7 @@
 
 	const getAllAlbums = async () => {
 		try {
-			const { data } = await api.albumApi.getAllAlbums(undefined, asset.id);
+			const { data } = await api.albumApi.getAllAlbums({ assetId: asset.id });
 			appearsInAlbums = data;
 		} catch (e) {
 			console.error('Error getting album that asset belong to', e);
@@ -151,16 +151,19 @@
 
 			$downloadAssets[imageFileName] = 0;
 
-			const { data, status } = await api.assetApi.downloadFile(assetId, key, {
-				responseType: 'blob',
-				onDownloadProgress: (progressEvent) => {
-					if (progressEvent.lengthComputable) {
-						const total = progressEvent.total;
-						const current = progressEvent.loaded;
-						$downloadAssets[imageFileName] = Math.floor((current / total) * 100);
+			const { data, status } = await api.assetApi.downloadFile(
+				{ assetId, key },
+				{
+					responseType: 'blob',
+					onDownloadProgress: (progressEvent) => {
+						if (progressEvent.lengthComputable) {
+							const total = progressEvent.total;
+							const current = progressEvent.loaded;
+							$downloadAssets[imageFileName] = Math.floor((current / total) * 100);
+						}
 					}
 				}
-			});
+			);
 
 			if (!(data instanceof Blob)) {
 				return;
@@ -203,7 +206,9 @@
 				)
 			) {
 				const { data: deletedAssets } = await api.assetApi.deleteAsset({
-					ids: [asset.id]
+					deleteAssetDto: {
+						ids: [asset.id]
+					}
 				});
 
 				navigateAssetForward();
@@ -224,8 +229,11 @@
 	};
 
 	const toggleFavorite = async () => {
-		const { data } = await api.assetApi.updateAsset(asset.id, {
-			isFavorite: !asset.isFavorite
+		const { data } = await api.assetApi.updateAsset({
+			assetId: asset.id,
+			updateAssetDto: {
+				isFavorite: !asset.isFavorite
+			}
 		});
 
 		asset.isFavorite = data.isFavorite;
@@ -241,10 +249,12 @@
 		isShowAlbumPicker = false;
 
 		const { albumName }: { albumName: string } = event.detail;
-		api.albumApi.createAlbum({ albumName, assetIds: [asset.id] }).then((response) => {
-			const album = response.data;
-			goto('/albums/' + album.id);
-		});
+		api.albumApi
+			.createAlbum({ createAlbumDto: { albumName, assetIds: [asset.id] } })
+			.then((response) => {
+				const album = response.data;
+				goto('/albums/' + album.id);
+			});
 	};
 
 	const handleAddToAlbum = async (event: CustomEvent<{ album: AlbumResponseDto }>) => {
@@ -272,8 +282,11 @@
 
 	const toggleArchive = async () => {
 		try {
-			const { data } = await api.assetApi.updateAsset(asset.id, {
-				isArchived: !asset.isArchived
+			const { data } = await api.assetApi.updateAsset({
+				assetId: asset.id,
+				updateAssetDto: {
+					isArchived: !asset.isArchived
+				}
 			});
 
 			asset.isArchived = data.isArchived;

+ 6 - 3
web/src/lib/components/asset-viewer/detail-panel.svelte

@@ -21,7 +21,7 @@
 	$: {
 		// Get latest description from server
 		if (asset.id) {
-			api.assetApi.getAssetById(asset.id).then((res) => {
+			api.assetApi.getAssetById({ assetId: asset.id }).then((res) => {
 				people = res.data?.people || [];
 				textarea.value = res.data?.exifInfo?.description || '';
 			});
@@ -64,8 +64,11 @@
 	const handleFocusOut = async () => {
 		dispatch('description-focus-out');
 		try {
-			await api.assetApi.updateAsset(asset.id, {
-				description: description
+			await api.assetApi.updateAsset({
+				assetId: asset.id,
+				updateAssetDto: {
+					description: description
+				}
 			});
 		} catch (error) {
 			console.error(error);

+ 6 - 3
web/src/lib/components/asset-viewer/photo-viewer.svelte

@@ -26,9 +26,12 @@
 
 	const loadAssetData = async () => {
 		try {
-			const { data } = await api.assetApi.serveFile(asset.id, false, true, publicSharedKey, {
-				responseType: 'blob'
-			});
+			const { data } = await api.assetApi.serveFile(
+				{ assetId: asset.id, isThumb: false, isWeb: true, key: publicSharedKey },
+				{
+					responseType: 'blob'
+				}
+			);
 
 			if (!(data instanceof Blob)) {
 				return;

+ 6 - 4
web/src/lib/components/forms/admin-registration-form.svelte

@@ -31,10 +31,12 @@
 			const lastName = form.get('lastName');
 
 			const { status } = await api.authenticationApi.adminSignUp({
-				email: String(email),
-				password: String(password),
-				firstName: String(firstName),
-				lastName: String(lastName)
+				signUpDto: {
+					email: String(email),
+					password: String(password),
+					firstName: String(firstName),
+					lastName: String(lastName)
+				}
 			});
 
 			if (status === 201) {

+ 5 - 3
web/src/lib/components/forms/change-password-form.svelte

@@ -29,9 +29,11 @@
 			error = '';
 
 			const { status } = await api.userApi.updateUser({
-				id: user.id,
-				password: String(password),
-				shouldChangePassword: false
+				updateUserDto: {
+					id: user.id,
+					password: String(password),
+					shouldChangePassword: false
+				}
 			});
 
 			if (status === 200) {

+ 6 - 4
web/src/lib/components/forms/create-user-form.svelte

@@ -46,10 +46,12 @@
 
 			try {
 				const { status } = await api.userApi.createUser({
-					email: String(email),
-					password: String(password),
-					firstName: String(firstName),
-					lastName: String(lastName)
+					createUserDto: {
+						email: String(email),
+						password: String(password),
+						firstName: String(firstName),
+						lastName: String(lastName)
+					}
 				});
 
 				if (status === 201) {

+ 12 - 8
web/src/lib/components/forms/edit-user-form.svelte

@@ -21,11 +21,13 @@
 		try {
 			const { id, email, firstName, lastName, storageLabel } = user;
 			const { status } = await api.userApi.updateUser({
-				id,
-				email,
-				firstName,
-				lastName,
-				storageLabel: storageLabel || ''
+				updateUserDto: {
+					id,
+					email,
+					firstName,
+					lastName,
+					storageLabel: storageLabel || ''
+				}
 			});
 
 			if (status === 200) {
@@ -42,9 +44,11 @@
 				const defaultPassword = 'password';
 
 				const { status } = await api.userApi.updateUser({
-					id: user.id,
-					password: defaultPassword,
-					shouldChangePassword: true
+					updateUserDto: {
+						id: user.id,
+						password: defaultPassword,
+						shouldChangePassword: true
+					}
 				});
 
 				if (status == 200) {

+ 4 - 2
web/src/lib/components/forms/login-form.svelte

@@ -57,8 +57,10 @@
 			loading = true;
 
 			const { data } = await api.authenticationApi.login({
-				email,
-				password
+				loginCredentialDto: {
+					email,
+					password
+				}
 			});
 
 			if (!data.isAdmin && data.shouldChangePassword) {

+ 1 - 1
web/src/lib/components/photos-page/actions/add-to-album.svelte

@@ -27,7 +27,7 @@
 
 		const { albumName }: { albumName: string } = event.detail;
 		const assetIds = Array.from(getAssets()).map((asset) => asset.id);
-		api.albumApi.createAlbum({ albumName, assetIds }).then((response) => {
+		api.albumApi.createAlbum({ createAlbumDto: { albumName, assetIds } }).then((response) => {
 			const { id, albumName } = response.data;
 
 			notificationController.show({

+ 1 - 1
web/src/lib/components/photos-page/actions/archive-action.svelte

@@ -28,7 +28,7 @@
 
 		for (const asset of getAssets()) {
 			if (asset.isArchived !== isArchived) {
-				api.assetApi.updateAsset(asset.id, { isArchived });
+				api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isArchived } });
 
 				onAssetArchive(asset, isArchived);
 				cnt = cnt + 1;

+ 3 - 1
web/src/lib/components/photos-page/actions/delete-assets.svelte

@@ -20,7 +20,9 @@
 			let count = 0;
 
 			const { data: deletedAssets } = await api.assetApi.deleteAsset({
-				ids: Array.from(getAssets()).map((a) => a.id)
+				deleteAssetDto: {
+					ids: Array.from(getAssets()).map((a) => a.id)
+				}
 			});
 
 			for (const asset of deletedAssets) {

+ 1 - 1
web/src/lib/components/photos-page/actions/favorite-action.svelte

@@ -28,7 +28,7 @@
 		let cnt = 0;
 		for (const asset of getAssets()) {
 			if (asset.isFavorite !== isFavorite) {
-				api.assetApi.updateAsset(asset.id, { isFavorite });
+				api.assetApi.updateAsset({ assetId: asset.id, updateAssetDto: { isFavorite } });
 				onAssetFavorite(asset, isFavorite);
 				cnt = cnt + 1;
 			}

+ 5 - 2
web/src/lib/components/photos-page/actions/remove-from-album.svelte

@@ -15,8 +15,11 @@
 	const handleRemoveFromAlbum = async () => {
 		if (window.confirm('Do you want to remove selected assets from the album?')) {
 			try {
-				const { data } = await api.albumApi.removeAssetFromAlbum(album.id, {
-					assetIds: Array.from(getAssets()).map((a) => a.id)
+				const { data } = await api.albumApi.removeAssetFromAlbum({
+					id: album.id,
+					removeAssetsDto: {
+						assetIds: Array.from(getAssets()).map((a) => a.id)
+					}
 				});
 
 				album = data;

+ 4 - 4
web/src/lib/components/photos-page/actions/remove-from-shared-link.svelte

@@ -14,12 +14,12 @@
 			// TODO: Rename API method or change functionality. The assetIds passed
 			// in are kept instead of removed.
 			const assetsToKeep = allAssets.filter((a) => !getAssets().has(a));
-			await api.assetApi.removeAssetsFromSharedLink(
-				{
+			await api.assetApi.removeAssetsFromSharedLink({
+				removeAssetsDto: {
 					assetIds: assetsToKeep.map((a) => a.id)
 				},
-				sharedLink?.key
-			);
+				key: sharedLink?.key
+			});
 
 			sharedLink.assets = assetsToKeep;
 			clearSelect();

+ 4 - 2
web/src/lib/components/photos-page/asset-grid.svelte

@@ -28,8 +28,10 @@
 
 	onMount(async () => {
 		const { data: assetCountByTimebucket } = await api.assetApi.getAssetCountByTimeBucket({
-			timeGroup: TimeGroupEnum.Month,
-			userId: user?.id
+			getAssetCountByTimeBucketDto: {
+				timeGroup: TimeGroupEnum.Month,
+				userId: user?.id
+			}
 		});
 		bucketInfo = assetCountByTimebucket;
 

+ 4 - 4
web/src/lib/components/share-page/individual-shared-viewer.svelte

@@ -40,12 +40,12 @@
 
 			const assetIds = results.filter((id) => !!id) as string[];
 
-			await api.assetApi.addAssetsToSharedLink(
-				{
+			await api.assetApi.addAssetsToSharedLink({
+				addAssetsDto: {
 					assetIds
 				},
-				sharedLink?.key
-			);
+				key: sharedLink?.key
+			});
 
 			notificationController.show({
 				message: `Successfully add ${assetIds.length} to the shared link`,

+ 1 - 1
web/src/lib/components/shared-components/album-selection-modal.svelte

@@ -16,7 +16,7 @@
 	export let shared: boolean;
 
 	onMount(async () => {
-		const { data } = await api.albumApi.getAllAlbums(shared || undefined);
+		const { data } = await api.albumApi.getAllAlbums({ shared: shared || undefined });
 		albums = data;
 
 		recentAlbums = albums

+ 6 - 3
web/src/lib/components/shared-components/circle-avatar.svelte

@@ -10,9 +10,12 @@
 	const dispatch = createEventDispatcher();
 
 	const getUserAvatar = async () => {
-		const { data } = await api.userApi.getProfileImage(user.id, {
-			responseType: 'blob'
-		});
+		const { data } = await api.userApi.getProfileImage(
+			{ userId: user.id },
+			{
+				responseType: 'blob'
+			}
+		);
 
 		if (data instanceof Blob) {
 			return URL.createObjectURL(data);

+ 25 - 18
web/src/lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte

@@ -60,22 +60,26 @@
 		try {
 			if (shareType === SharedLinkType.Album && album) {
 				const { data } = await api.albumApi.createAlbumSharedLink({
-					albumId: album.id,
-					expiresAt: expirationDate,
-					allowUpload: isAllowUpload,
-					description: description,
-					allowDownload: isAllowDownload,
-					showExif: shouldShowExif
+					createAlbumShareLinkDto: {
+						albumId: album.id,
+						expiresAt: expirationDate,
+						allowUpload: isAllowUpload,
+						description: description,
+						allowDownload: isAllowDownload,
+						showExif: shouldShowExif
+					}
 				});
 				buildSharedLink(data);
 			} else {
 				const { data } = await api.assetApi.createAssetsSharedLink({
-					assetIds: sharedAssets.map((a) => a.id),
-					expiresAt: expirationDate,
-					allowUpload: isAllowUpload,
-					description: description,
-					allowDownload: isAllowDownload,
-					showExif: shouldShowExif
+					createAssetsShareLinkDto: {
+						assetIds: sharedAssets.map((a) => a.id),
+						expiresAt: expirationDate,
+						allowUpload: isAllowUpload,
+						description: description,
+						allowDownload: isAllowDownload,
+						showExif: shouldShowExif
+					}
 				});
 				buildSharedLink(data);
 			}
@@ -133,12 +137,15 @@
 					? new Date(currentTime + expirationTime).toISOString()
 					: null;
 
-				await api.shareApi.editSharedLink(editingLink.id, {
-					description,
-					expiresAt: shouldChangeExpirationTime ? expirationDate : undefined,
-					allowUpload: isAllowUpload,
-					allowDownload: isAllowDownload,
-					showExif: shouldShowExif
+				await api.shareApi.editSharedLink({
+					id: editingLink.id,
+					editSharedLinkDto: {
+						description,
+						expiresAt: shouldChangeExpirationTime ? expirationDate : undefined,
+						allowUpload: isAllowUpload,
+						allowDownload: isAllowDownload,
+						showExif: shouldShowExif
+					}
 				});
 
 				notificationController.show({

+ 1 - 1
web/src/lib/components/shared-components/side-bar/side-bar.svelte

@@ -30,7 +30,7 @@
 
 	const getFavoriteCount = async () => {
 		try {
-			const { data: assets } = await api.assetApi.getAllAssets(undefined, true, undefined);
+			const { data: assets } = await api.assetApi.getAllAssets({ isFavorite: true });
 
 			return {
 				favorites: assets.length

+ 1 - 1
web/src/lib/components/sharedlinks-page/shared-link-card.svelte

@@ -30,7 +30,7 @@
 			assetId = link.assets[0].id;
 		}
 
-		const { data } = await api.assetApi.getAssetById(assetId);
+		const { data } = await api.assetApi.getAssetById({ assetId });
 
 		return data;
 	};

+ 4 - 2
web/src/lib/components/user-settings-page/change-password-settings.svelte

@@ -17,8 +17,10 @@
 	const handleChangePassword = async () => {
 		try {
 			await api.authenticationApi.changePassword({
-				password,
-				newPassword
+				changePasswordDto: {
+					password,
+					newPassword
+				}
 			});
 
 			notificationController.show({

+ 1 - 1
web/src/lib/components/user-settings-page/device-list.svelte

@@ -29,7 +29,7 @@
 		}
 
 		try {
-			await api.authenticationApi.logoutAuthDevice(deleteDevice.id);
+			await api.authenticationApi.logoutAuthDevice({ id: deleteDevice.id });
 			notificationController.show({ message: `Logged out device`, type: NotificationType.Info });
 		} catch (error) {
 			handleError(error, 'Unable to log out device');

+ 2 - 2
web/src/lib/components/user-settings-page/partner-selection-modal.svelte

@@ -15,13 +15,13 @@
 
 	onMount(async () => {
 		// TODO: update endpoint to have a query param for deleted users
-		let { data: users } = await api.userApi.getAllUsers(false);
+		let { data: users } = await api.userApi.getAllUsers({ isAll: false });
 
 		// remove invalid users
 		users = users.filter((_user) => !(_user.deletedAt || _user.id === user.id));
 
 		// exclude partners from the list of users available for selection
-		const { data: partners } = await api.partnerApi.getPartners('shared-by');
+		const { data: partners } = await api.partnerApi.getPartners({ direction: 'shared-by' });
 		const partnerIds = partners.map((partner) => partner.id);
 		availableUsers = users.filter((user) => !partnerIds.includes(user.id));
 	});

+ 3 - 3
web/src/lib/components/user-settings-page/partner-settings.svelte

@@ -16,7 +16,7 @@
 	let removePartner: UserResponseDto | null = null;
 
 	const refreshPartners = async () => {
-		const { data } = await api.partnerApi.getPartners('shared-by');
+		const { data } = await api.partnerApi.getPartners({ direction: 'shared-by' });
 		partners = data;
 	};
 
@@ -26,7 +26,7 @@
 		}
 
 		try {
-			await api.partnerApi.removePartner(removePartner.id);
+			await api.partnerApi.removePartner({ id: removePartner.id });
 			removePartner = null;
 			await refreshPartners();
 		} catch (error) {
@@ -37,7 +37,7 @@
 	const handleCreatePartners = async (users: UserResponseDto[]) => {
 		try {
 			for (const user of users) {
-				await api.partnerApi.createPartner(user.id);
+				await api.partnerApi.createPartner({ id: user.id });
 			}
 
 			await refreshPartners();

+ 3 - 3
web/src/lib/components/user-settings-page/user-api-key-list.svelte

@@ -40,7 +40,7 @@
 	const handleCreate = async (event: CustomEvent<APIKeyResponseDto>) => {
 		try {
 			const dto = event.detail;
-			const { data } = await api.keyApi.createKey(dto);
+			const { data } = await api.keyApi.createKey({ aPIKeyCreateDto: dto });
 			secret = data.secret;
 		} catch (error) {
 			handleError(error, 'Unable to create a new API Key');
@@ -58,7 +58,7 @@
 		const dto = event.detail;
 
 		try {
-			await api.keyApi.updateKey(editKey.id, { name: dto.name });
+			await api.keyApi.updateKey({ id: editKey.id, aPIKeyUpdateDto: { name: dto.name } });
 			notificationController.show({
 				message: `Saved API Key`,
 				type: NotificationType.Info
@@ -77,7 +77,7 @@
 		}
 
 		try {
-			await api.keyApi.deleteKey(deleteKey.id);
+			await api.keyApi.deleteKey({ id: deleteKey.id });
 			notificationController.show({
 				message: `Removed API Key: ${deleteKey.name}`,
 				type: NotificationType.Info

+ 6 - 4
web/src/lib/components/user-settings-page/user-profile-settings.svelte

@@ -16,10 +16,12 @@
 	const handleSaveProfile = async () => {
 		try {
 			const { data } = await api.userApi.updateUser({
-				id: user.id,
-				email: user.email,
-				firstName: user.firstName,
-				lastName: user.lastName
+				updateUserDto: {
+					id: user.id,
+					email: user.email,
+					firstName: user.firstName,
+					lastName: user.lastName
+				}
 			});
 
 			Object.assign(user, data);

+ 1 - 1
web/src/lib/stores/asset-interaction.store.ts

@@ -57,7 +57,7 @@ function createAssetInteractionStore() {
 	};
 
 	const setViewingAssetId = async (id: string) => {
-		const { data } = await api.assetApi.getAssetById(id);
+		const { data } = await api.assetApi.getAssetById({ assetId: id });
 		viewingAssetStoreState.set(data);
 		isViewingAssetStoreState.set(true);
 	};

+ 5 - 3
web/src/lib/stores/assets.store.ts

@@ -66,9 +66,11 @@ function createAssetStore() {
 			});
 			const { data: assets } = await api.assetApi.getAssetByTimeBucket(
 				{
-					timeBucket: [bucket],
-					userId: _assetGridState.userId,
-					withoutThumbs: true
+					getAssetByTimeBucketDto: {
+						timeBucket: [bucket],
+						userId: _assetGridState.userId,
+						withoutThumbs: true
+					}
 				},
 				{ signal: currentBucketData?.cancelToken.signal }
 			);

+ 27 - 22
web/src/lib/utils/asset-utils.ts

@@ -10,17 +10,19 @@ export const addAssetsToAlbum = async (
 	assetIds: Array<string>,
 	key: string | undefined = undefined
 ): Promise<AddAssetsResponseDto> =>
-	api.albumApi.addAssetsToAlbum(albumId, { assetIds }, key).then(({ data: dto }) => {
-		if (dto.successfullyAdded > 0) {
-			// This might be 0 if the user tries to add an asset that is already in the album
-			notificationController.show({
-				message: `Added ${dto.successfullyAdded} to ${dto.album?.albumName}`,
-				type: NotificationType.Info
-			});
-		}
+	api.albumApi
+		.addAssetsToAlbum({ id: albumId, addAssetsDto: { assetIds }, key })
+		.then(({ data: dto }) => {
+			if (dto.successfullyAdded > 0) {
+				// This might be 0 if the user tries to add an asset that is already in the album
+				notificationController.show({
+					message: `Added ${dto.successfullyAdded} to ${dto.album?.albumName}`,
+					type: NotificationType.Info
+				});
+			}
 
-		return dto;
-	});
+			return dto;
+		});
 
 export async function bulkDownload(
 	fileName: string,
@@ -43,20 +45,23 @@ export async function bulkDownload(
 
 			let total = 0;
 
-			const { data, status, headers } = await api.assetApi.downloadFiles({ assetIds }, key, {
-				responseType: 'blob',
-				onDownloadProgress: function (progressEvent) {
-					const request = this as XMLHttpRequest;
-					if (!total) {
-						total = Number(request.getResponseHeader('X-Immich-Content-Length-Hint')) || 0;
-					}
-
-					if (total) {
-						const current = progressEvent.loaded;
-						downloadAssets.set({ [downloadFileName]: Math.floor((current / total) * 100) });
+			const { data, status, headers } = await api.assetApi.downloadFiles(
+				{ downloadFilesDto: { assetIds }, key },
+				{
+					responseType: 'blob',
+					onDownloadProgress: function (progressEvent) {
+						const request = this as XMLHttpRequest;
+						if (!total) {
+							total = Number(request.getResponseHeader('X-Immich-Content-Length-Hint')) || 0;
+						}
+
+						if (total) {
+							const current = progressEvent.loaded;
+							downloadAssets.set({ [downloadFileName]: Math.floor((current / total) * 100) });
+						}
 					}
 				}
-			});
+			);
 
 			const isNotComplete = headers['x-immich-archive-complete'] === 'false';
 			const fileCount = Number(headers['x-immich-archive-file-count']) || 0;

+ 1 - 1
web/src/routes/(user)/albums/[albumId]/+page.server.ts

@@ -10,7 +10,7 @@ export const load = (async ({ params, locals: { api, user } }) => {
 	const albumId = params['albumId'];
 
 	try {
-		const { data: album } = await api.albumApi.getAlbumInfo(albumId);
+		const { data: album } = await api.albumApi.getAlbumInfo({ id: albumId });
 		return {
 			album,
 			meta: {

+ 2 - 2
web/src/routes/(user)/albums/__tests__/albums.bloc.spec.ts

@@ -90,7 +90,7 @@ describe('Albums BLoC', () => {
 		const newAlbum = await sut.createAlbum();
 
 		expect(apiMock.albumApi.createAlbum).toHaveBeenCalledTimes(1);
-		expect(apiMock.albumApi.createAlbum).toHaveBeenCalledWith(payload);
+		expect(apiMock.albumApi.createAlbum).toHaveBeenCalledWith({ createAlbumDto: payload });
 		expect(newAlbum).toEqual(returnedAlbum);
 	});
 
@@ -130,7 +130,7 @@ describe('Albums BLoC', () => {
 		const updatedAlbums = get(sut.albums);
 
 		expect(apiMock.albumApi.deleteAlbum).toHaveBeenCalledTimes(1);
-		expect(apiMock.albumApi.deleteAlbum).toHaveBeenCalledWith(albumToDeleteId);
+		expect(apiMock.albumApi.deleteAlbum).toHaveBeenCalledWith({ id: albumToDeleteId });
 		expect(updatedAlbums).toHaveLength(4);
 		expect(updatedAlbums).not.toContain(albumToDelete);
 		expect(get(sut.isShowContextMenu)).toBe(false);

+ 5 - 3
web/src/routes/(user)/albums/albums.bloc.ts

@@ -40,7 +40,9 @@ export const useAlbums = (props: AlbumsProps) => {
 	async function createAlbum(): Promise<AlbumResponseDto | undefined> {
 		try {
 			const { data: newAlbum } = await api.albumApi.createAlbum({
-				albumName: 'Untitled'
+				createAlbumDto: {
+					albumName: 'Untitled'
+				}
 			});
 
 			return newAlbum;
@@ -53,7 +55,7 @@ export const useAlbums = (props: AlbumsProps) => {
 	}
 
 	async function deleteAlbum(album: AlbumResponseDto): Promise<void> {
-		await api.albumApi.deleteAlbum(album.id);
+		await api.albumApi.deleteAlbum({ id: album.id });
 	}
 
 	async function showAlbumContextMenu(
@@ -83,7 +85,7 @@ export const useAlbums = (props: AlbumsProps) => {
 			)
 		) {
 			try {
-				await api.albumApi.deleteAlbum(albumToDelete.id);
+				await api.albumApi.deleteAlbum({ id: albumToDelete.id });
 				const _albums = get(albums);
 				albums.set(_albums.filter((a) => a.id !== albumToDelete.id));
 			} catch {

+ 1 - 1
web/src/routes/(user)/archive/+page.svelte

@@ -26,7 +26,7 @@
 
 	onMount(async () => {
 		try {
-			const { data: assets } = await api.assetApi.getAllAssets(undefined, undefined, true);
+			const { data: assets } = await api.assetApi.getAllAssets({ isArchived: true });
 			$archivedAsset = assets;
 		} catch {
 			handleError(Error, 'Unable to load archived assets');

+ 1 - 1
web/src/routes/(user)/favorites/+page.svelte

@@ -28,7 +28,7 @@
 
 	onMount(async () => {
 		try {
-			const { data: assets } = await api.assetApi.getAllAssets(undefined, true, undefined);
+			const { data: assets } = await api.assetApi.getAllAssets({ isFavorite: true });
 			favorites = assets;
 		} catch {
 			handleError(Error, 'Unable to load favorites');

+ 5 - 3
web/src/routes/(user)/map/+page.svelte

@@ -48,9 +48,11 @@
 		const { fileCreatedAfter, fileCreatedBefore } = getFileCreatedDates();
 
 		const { data } = await api.assetApi.getMapMarkers(
-			onlyFavorites || undefined,
-			fileCreatedAfter,
-			fileCreatedBefore,
+			{
+				isFavorite: onlyFavorites || undefined,
+				fileCreatedAfter,
+				fileCreatedBefore
+			},
 			{
 				signal: abortController.signal
 			}

+ 1 - 1
web/src/routes/(user)/partners/[userId]/+page.server.ts

@@ -9,7 +9,7 @@ export const load: PageServerLoad = async ({ params, parent, locals: { api } })
 		throw redirect(302, AppRoute.AUTH_LOGIN);
 	}
 
-	const { data: partner } = await api.userApi.getUserById(params['userId']);
+	const { data: partner } = await api.userApi.getUserById({ userId: params['userId'] });
 
 	return {
 		user,

+ 2 - 2
web/src/routes/(user)/people/[personId]/+page.server.ts

@@ -7,8 +7,8 @@ export const load = (async ({ locals, parent, params }) => {
 		throw redirect(302, '/auth/login');
 	}
 
-	const { data: person } = await locals.api.personApi.getPerson(params.personId);
-	const { data: assets } = await locals.api.personApi.getPersonAssets(params.personId);
+	const { data: person } = await locals.api.personApi.getPerson({ id: params.personId });
+	const { data: assets } = await locals.api.personApi.getPersonAssets({ id: params.personId });
 
 	return {
 		user,

+ 1 - 1
web/src/routes/(user)/people/[personId]/+page.svelte

@@ -41,7 +41,7 @@
 		try {
 			isEditName = false;
 			data.person.name = name;
-			await api.personApi.updatePerson(data.person.id, { name });
+			await api.personApi.updatePerson({ id: data.person.id, personUpdateDto: { name } });
 		} catch (error) {
 			handleError(error, 'Unable to save name');
 		}

+ 1 - 18
web/src/routes/(user)/search/+page.server.ts

@@ -9,24 +9,7 @@ export const load = (async ({ locals, parent, url }) => {
 
 	const term = url.searchParams.get('q') || url.searchParams.get('query') || undefined;
 
-	const { data: results } = await locals.api.searchApi.search(
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		undefined,
-		{ params: url.searchParams }
-	);
+	const { data: results } = await locals.api.searchApi.search({}, { params: url.searchParams });
 
 	return {
 		user,

+ 1 - 1
web/src/routes/(user)/share/[key]/+page.server.ts

@@ -7,7 +7,7 @@ export const load = (async ({ params, locals: { api } }) => {
 	const { key } = params;
 
 	try {
-		const { data: sharedLink } = await api.shareApi.getMySharedLink(key);
+		const { data: sharedLink } = await api.shareApi.getMySharedLink({ key });
 
 		const assetCount = sharedLink.assets.length;
 		const assetId = sharedLink.album?.albumThumbnailAssetId || sharedLink.assets[0]?.id;

+ 1 - 1
web/src/routes/(user)/share/[key]/photos/[assetId]/+page.server.ts

@@ -6,7 +6,7 @@ import type { PageServerLoad } from './$types';
 export const load = (async ({ params, locals: { api } }) => {
 	try {
 		const { key, assetId } = params;
-		const { data: asset } = await api.assetApi.getAssetById(assetId, key);
+		const { data: asset } = await api.assetApi.getAssetById({ assetId, key });
 
 		if (!asset) {
 			return error(404, 'Asset not found');

+ 2 - 2
web/src/routes/(user)/sharing/+page.server.ts

@@ -8,8 +8,8 @@ export const load = (async ({ locals: { api, user } }) => {
 	}
 
 	try {
-		const { data: sharedAlbums } = await api.albumApi.getAllAlbums(true);
-		const { data: partners } = await api.partnerApi.getPartners('shared-with');
+		const { data: sharedAlbums } = await api.albumApi.getAllAlbums({ shared: true });
+		const { data: partners } = await api.partnerApi.getPartners({ direction: 'shared-with' });
 
 		return {
 			user,

+ 3 - 1
web/src/routes/(user)/sharing/+page.svelte

@@ -21,7 +21,9 @@
 	const createSharedAlbum = async () => {
 		try {
 			const { data: newAlbum } = await api.albumApi.createAlbum({
-				albumName: 'Untitled'
+				createAlbumDto: {
+					albumName: 'Untitled'
+				}
 			});
 
 			goto('/albums/' + newAlbum.id);

+ 2 - 2
web/src/routes/(user)/sharing/sharedlinks/+page.svelte

@@ -29,7 +29,7 @@
 	const handleDeleteLink = async (linkId: string) => {
 		if (window.confirm('Do you want to delete the shared link? ')) {
 			try {
-				await api.shareApi.removeSharedLink(linkId);
+				await api.shareApi.removeSharedLink({ id: linkId });
 				notificationController.show({
 					message: 'Shared link deleted',
 					type: NotificationType.Info
@@ -47,7 +47,7 @@
 	};
 
 	const handleEditLink = async (id: string) => {
-		const { data } = await api.shareApi.getSharedLinkById(id);
+		const { data } = await api.shareApi.getSharedLinkById({ id });
 		editSharedLink = data;
 		showEditForm = true;
 	};

+ 1 - 1
web/src/routes/+page.server.ts

@@ -9,7 +9,7 @@ export const load = (async ({ parent, locals: { api } }) => {
 		throw redirect(302, '/photos');
 	}
 
-	const { data } = await api.userApi.getUserCount(true);
+	const { data } = await api.userApi.getUserCount({ admin: true });
 
 	if (data.userCount > 0) {
 		// Redirect to login page if an admin is already registered.

+ 1 - 1
web/src/routes/admin/user-management/+page.server.ts

@@ -10,7 +10,7 @@ export const load = (async ({ parent, locals: { api } }) => {
 		throw redirect(302, '/photos');
 	}
 
-	const { data: allUsers } = await api.userApi.getAllUsers(false);
+	const { data: allUsers } = await api.userApi.getAllUsers({ isAll: false });
 
 	return {
 		user,

+ 7 - 7
web/src/routes/admin/user-management/+page.svelte

@@ -46,7 +46,7 @@
 	};
 
 	const onUserCreated = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowCreateUserForm = false;
 	};
@@ -57,13 +57,13 @@
 	};
 
 	const onEditUserSuccess = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowEditUserForm = false;
 	};
 
 	const onEditPasswordSuccess = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowEditUserForm = false;
 		shouldShowInfoPanel = true;
@@ -75,13 +75,13 @@
 	};
 
 	const onUserDeleteSuccess = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowDeleteConfirmDialog = false;
 	};
 
 	const onUserDeleteFail = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowDeleteConfirmDialog = false;
 	};
@@ -92,14 +92,14 @@
 	};
 
 	const onUserRestoreSuccess = async () => {
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowRestoreDialog = false;
 	};
 
 	const onUserRestoreFail = async () => {
 		// show fail dialog
-		const getAllUsersRes = await api.userApi.getAllUsers(false);
+		const getAllUsersRes = await api.userApi.getAllUsers({ isAll: false });
 		allUsers = getAllUsersRes.data;
 		shouldShowRestoreDialog = false;
 	};

+ 2 - 2
web/src/routes/auth/login/+page.server.ts

@@ -4,7 +4,7 @@ import type { OAuthConfigResponseDto } from '@api';
 import type { PageServerLoad } from './$types';
 
 export const load = (async ({ locals: { api } }) => {
-	const { data } = await api.userApi.getUserCount(true);
+	const { data } = await api.userApi.getUserCount({ admin: true });
 	if (data.userCount === 0) {
 		// Admin not registered
 		throw redirect(302, AppRoute.AUTH_REGISTER);
@@ -17,7 +17,7 @@ export const load = (async ({ locals: { api } }) => {
 
 	try {
 		// TODO: Figure out how to get correct redirect URI server-side.
-		const { data } = await api.oauthApi.generateConfig({ redirectUri: '/' });
+		const { data } = await api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri: '/' } });
 		data.url = undefined;
 
 		authConfig = data;

+ 1 - 1
web/src/routes/auth/register/+page.server.ts

@@ -2,7 +2,7 @@ import { redirect } from '@sveltejs/kit';
 import type { PageServerLoad } from './$types';
 
 export const load = (async ({ locals: { api } }) => {
-	const { data } = await api.userApi.getUserCount(true);
+	const { data } = await api.userApi.getUserCount({ admin: true });
 	if (data.userCount != 0) {
 		// Admin has been registered, redirect to login
 		throw redirect(302, '/auth/login');

Some files were not shown because too many files changed in this diff