|
@@ -4,6 +4,8 @@ import { apiv3Get } from '~/client/util/apiv3-client';
|
|
|
|
|
|
|
|
import { IUserHasId } from '~/interfaces/user';
|
|
import { IUserHasId } from '~/interfaces/user';
|
|
|
|
|
|
|
|
|
|
+import { checkAndUpdateImageUrlCached } from '~/stores/middlewares/user';
|
|
|
|
|
+
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
export const useSWRxUsersList = <Data, Error>(userIds: string[]): SWRResponse<IUserHasId[], Error> => {
|
|
export const useSWRxUsersList = <Data, Error>(userIds: string[]): SWRResponse<IUserHasId[], Error> => {
|
|
|
const distinctUserIds = userIds.length > 0 ? Array.from(new Set(userIds)).sort() : [];
|
|
const distinctUserIds = userIds.length > 0 ? Array.from(new Set(userIds)).sort() : [];
|
|
@@ -12,5 +14,6 @@ export const useSWRxUsersList = <Data, Error>(userIds: string[]): SWRResponse<IU
|
|
|
(endpoint, userIds) => apiv3Get(endpoint, { userIds: userIds.join(',') }).then((response) => {
|
|
(endpoint, userIds) => apiv3Get(endpoint, { userIds: userIds.join(',') }).then((response) => {
|
|
|
return response.data.users;
|
|
return response.data.users;
|
|
|
}),
|
|
}),
|
|
|
|
|
+ { use: [checkAndUpdateImageUrlCached] },
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|