UNPKG

@replyke/core

Version:

Replyke: Build interactive apps with social features like comments, votes, feeds, user lists, notifications, and more.

35 lines 1.53 kB
import { baseApi } from './baseApi'; // Removed FetchUserRequest and FetchUserByForeignIdRequest - these are for other users, not current user management // Inject user-specific endpoints into the base API export var userApi = baseApi.injectEndpoints({ endpoints: function (builder) { return ({ // Update current user updateUser: builder.mutation({ query: function (_a) { var projectId = _a.projectId, userId = _a.userId, update = _a.update; return ({ url: "/".concat(projectId, "/users/").concat(userId), method: 'PATCH', body: { update: update }, }); }, // No complex optimistic updates needed - let useUserActions handle state updates invalidatesTags: function (result, error, _a) { var userId = _a.userId; return [ { type: 'User', id: 'CURRENT' }, // Only current user now ]; }, }), // Removed other-user queries - these should use the existing legacy hooks: // - useFetchUser // - useFetchUserByForeignId // - useFetchUserFollowersCount // - useFetchUserFollowingCount // - useCheckUsernameAvailability // - useFetchUserSuggestions }); }, }); // Export generated hooks (current user management only) export var useUpdateUserMutation = userApi.useUpdateUserMutation; //# sourceMappingURL=userApi.js.map