UNPKG

@replyke/core

Version:

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

38 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useUpdateUserMutation = exports.userApi = void 0; var baseApi_1 = require("./baseApi"); // Removed FetchUserRequest and FetchUserByForeignIdRequest - these are for other users, not current user management // Inject user-specific endpoints into the base API exports.userApi = baseApi_1.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) exports.useUpdateUserMutation = exports.userApi.useUpdateUserMutation; //# sourceMappingURL=userApi.js.map