@replyke/core 6.0.0-beta.1 → 6.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/addNotificationsMessages.d.ts +2 -2
- package/dist/cjs/helpers/addNotificationsMessages.js +3 -2
- package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/cjs/hooks/comments/useCommentSectionData.js +4 -1
- package/dist/cjs/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/cjs/hooks/comments/useReplies.d.ts +0 -8
- package/dist/cjs/hooks/comments/useReplies.js +7 -1
- package/dist/cjs/hooks/comments/useReplies.js.map +1 -1
- package/dist/cjs/hooks/relationships/connections/index.d.ts +13 -0
- package/dist/cjs/hooks/relationships/connections/index.js +33 -0
- package/dist/cjs/hooks/relationships/connections/index.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
- package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js +76 -0
- package/dist/cjs/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
- package/dist/cjs/hooks/relationships/connections/useConnectionManager.js +342 -0
- package/dist/cjs/hooks/relationships/connections/useConnectionManager.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
- package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js +76 -0
- package/dist/cjs/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js +79 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnections.js +95 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnections.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js +75 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js +72 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +70 -0
- package/dist/cjs/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
- package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js +95 -0
- package/dist/cjs/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
- package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js +95 -0
- package/dist/cjs/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js +76 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js +79 -0
- package/dist/cjs/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
- package/dist/cjs/hooks/relationships/connections/useRequestConnection.js +71 -0
- package/dist/cjs/hooks/relationships/connections/useRequestConnection.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/index.d.ts +12 -3
- package/dist/cjs/hooks/relationships/follows/index.js +25 -7
- package/dist/cjs/hooks/relationships/follows/index.js.map +1 -1
- package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
- package/dist/cjs/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
- package/dist/cjs/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js +91 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js +70 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js +72 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
- package/dist/cjs/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +9 -10
- package/dist/cjs/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js +94 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js +75 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js +72 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
- package/dist/cjs/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +9 -10
- package/dist/cjs/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useFollowManager.js +8 -8
- package/dist/cjs/hooks/relationships/follows/useFollowManager.js.map +1 -1
- package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
- package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js +78 -0
- package/dist/cjs/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
- package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
- package/dist/cjs/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
- package/dist/cjs/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
- package/dist/cjs/hooks/useStableObject.d.ts +11 -0
- package/dist/cjs/hooks/useStableObject.js +26 -0
- package/dist/cjs/hooks/useStableObject.js.map +1 -0
- package/dist/cjs/hooks/users/index.d.ts +0 -2
- package/dist/cjs/hooks/users/index.js +1 -5
- package/dist/cjs/hooks/users/index.js.map +1 -1
- package/dist/cjs/hooks/users/useUpdateUser.d.ts +1 -2
- package/dist/cjs/hooks/users/useUpdateUser.js +7 -2
- package/dist/cjs/hooks/users/useUpdateUser.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +28 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/models/AppNotification.d.ts +32 -4
- package/dist/cjs/interfaces/models/Connection.d.ts +88 -0
- package/dist/cjs/interfaces/models/Connection.js +3 -0
- package/dist/cjs/interfaces/models/Connection.js.map +1 -0
- package/dist/cjs/interfaces/models/Follow.d.ts +2 -0
- package/dist/cjs/store/slices/entityListsSlice.js +9 -0
- package/dist/cjs/store/slices/entityListsSlice.js.map +1 -1
- package/dist/cjs/utils/objectComparison.d.ts +8 -0
- package/dist/cjs/utils/objectComparison.js +63 -0
- package/dist/cjs/utils/objectComparison.js.map +1 -0
- package/dist/esm/helpers/addNotificationsMessages.d.ts +2 -2
- package/dist/esm/helpers/addNotificationsMessages.js +3 -2
- package/dist/esm/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/esm/hooks/comments/useCommentSectionData.js +4 -1
- package/dist/esm/hooks/comments/useCommentSectionData.js.map +1 -1
- package/dist/esm/hooks/comments/useReplies.d.ts +0 -8
- package/dist/esm/hooks/comments/useReplies.js +7 -1
- package/dist/esm/hooks/comments/useReplies.js.map +1 -1
- package/dist/esm/hooks/relationships/connections/index.d.ts +13 -0
- package/dist/esm/hooks/relationships/connections/index.js +14 -0
- package/dist/esm/hooks/relationships/connections/index.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useAcceptConnection.d.ts +5 -0
- package/dist/esm/hooks/relationships/connections/useAcceptConnection.js +71 -0
- package/dist/esm/hooks/relationships/connections/useAcceptConnection.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useConnectionManager.d.ts +26 -0
- package/dist/esm/hooks/relationships/connections/useConnectionManager.js +337 -0
- package/dist/esm/hooks/relationships/connections/useConnectionManager.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useDeclineConnection.d.ts +5 -0
- package/dist/esm/hooks/relationships/connections/useDeclineConnection.js +71 -0
- package/dist/esm/hooks/relationships/connections/useDeclineConnection.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.d.ts +5 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js +74 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionStatus.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnections.d.ts +7 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnections.js +90 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnections.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.d.ts +8 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js +70 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.d.ts +3 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js +67 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCount.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.d.ts +6 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js +65 -0
- package/dist/esm/hooks/relationships/connections/useFetchConnectionsCountByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.d.ts +7 -0
- package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js +90 -0
- package/dist/esm/hooks/relationships/connections/useFetchReceivedPendingConnections.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.d.ts +7 -0
- package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js +90 -0
- package/dist/esm/hooks/relationships/connections/useFetchSentPendingConnections.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnection.d.ts +5 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnection.js +71 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnection.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.d.ts +5 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js +74 -0
- package/dist/esm/hooks/relationships/connections/useRemoveConnectionByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/connections/useRequestConnection.d.ts +3 -0
- package/dist/esm/hooks/relationships/connections/useRequestConnection.js +66 -0
- package/dist/esm/hooks/relationships/connections/useRequestConnection.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/index.d.ts +12 -3
- package/dist/esm/hooks/relationships/follows/index.js +12 -3
- package/dist/esm/hooks/relationships/follows/index.js.map +1 -1
- package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.d.ts +8 -0
- package/dist/esm/hooks/relationships/follows/{useFetchFollow.js → useFetchFollowStatus.js} +5 -5
- package/dist/esm/hooks/relationships/follows/useFetchFollowStatus.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowers.d.ts +23 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowers.js +86 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowers.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.d.ts +24 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js +65 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.d.ts +4 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js +67 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersCount.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.d.ts +6 -0
- package/dist/esm/hooks/{users/useFetchUserFollowersCount.js → relationships/follows/useFetchFollowersCountByUserId.js} +8 -9
- package/dist/esm/hooks/relationships/follows/useFetchFollowersCountByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowing.d.ts +23 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowing.js +89 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowing.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.d.ts +24 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js +70 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.d.ts +4 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js +67 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingCount.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.d.ts +6 -0
- package/dist/esm/hooks/{users/useFetchUserFollowingCount.js → relationships/follows/useFetchFollowingCountByUserId.js} +8 -9
- package/dist/esm/hooks/relationships/follows/useFetchFollowingCountByUserId.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useFollowManager.js +8 -8
- package/dist/esm/hooks/relationships/follows/useFollowManager.js.map +1 -1
- package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.d.ts +4 -0
- package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js +73 -0
- package/dist/esm/hooks/relationships/follows/useUnfollowByFollowId.js.map +1 -0
- package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.d.ts +4 -0
- package/dist/esm/hooks/relationships/follows/{useUnfollowUser.js → useUnfollowUserByUserId.js} +5 -5
- package/dist/esm/hooks/relationships/follows/useUnfollowUserByUserId.js.map +1 -0
- package/dist/esm/hooks/useStableObject.d.ts +11 -0
- package/dist/esm/hooks/useStableObject.js +23 -0
- package/dist/esm/hooks/useStableObject.js.map +1 -0
- package/dist/esm/hooks/users/index.d.ts +0 -2
- package/dist/esm/hooks/users/index.js +0 -2
- package/dist/esm/hooks/users/index.js.map +1 -1
- package/dist/esm/hooks/users/useUpdateUser.d.ts +1 -2
- package/dist/esm/hooks/users/useUpdateUser.js +7 -2
- package/dist/esm/hooks/users/useUpdateUser.js.map +1 -1
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/models/AppNotification.d.ts +32 -4
- package/dist/esm/interfaces/models/Connection.d.ts +88 -0
- package/dist/esm/interfaces/models/Connection.js +2 -0
- package/dist/esm/interfaces/models/Connection.js.map +1 -0
- package/dist/esm/interfaces/models/Follow.d.ts +2 -0
- package/dist/esm/store/slices/entityListsSlice.js +9 -0
- package/dist/esm/store/slices/entityListsSlice.js.map +1 -1
- package/dist/esm/utils/objectComparison.d.ts +8 -0
- package/dist/esm/utils/objectComparison.js +59 -0
- package/dist/esm/utils/objectComparison.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
- package/dist/cjs/hooks/relationships/follows/useFetchFollow.js.map +0 -1
- package/dist/cjs/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
- package/dist/cjs/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
- package/dist/cjs/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
- package/dist/cjs/hooks/users/useFetchUserFollowersCount.js.map +0 -1
- package/dist/cjs/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
- package/dist/cjs/hooks/users/useFetchUserFollowingCount.js.map +0 -1
- package/dist/esm/hooks/relationships/follows/useFetchFollow.d.ts +0 -6
- package/dist/esm/hooks/relationships/follows/useFetchFollow.js.map +0 -1
- package/dist/esm/hooks/relationships/follows/useUnfollowUser.d.ts +0 -4
- package/dist/esm/hooks/relationships/follows/useUnfollowUser.js.map +0 -1
- package/dist/esm/hooks/users/useFetchUserFollowersCount.d.ts +0 -6
- package/dist/esm/hooks/users/useFetchUserFollowersCount.js.map +0 -1
- package/dist/esm/hooks/users/useFetchUserFollowingCount.d.ts +0 -6
- package/dist/esm/hooks/users/useFetchUserFollowingCount.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
+
import useProject from "../../projects/useProject";
|
|
40
|
+
import { useUser } from "../../user";
|
|
41
|
+
function useRemoveConnection() {
|
|
42
|
+
var _this = this;
|
|
43
|
+
var axios = useAxiosPrivate();
|
|
44
|
+
var projectId = useProject().projectId;
|
|
45
|
+
var user = useUser().user;
|
|
46
|
+
var removeConnection = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
+
var connectionId, response;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
connectionId = props.connectionId;
|
|
52
|
+
if (!projectId) {
|
|
53
|
+
throw new Error("No project specified");
|
|
54
|
+
}
|
|
55
|
+
if (!user) {
|
|
56
|
+
throw new Error("No user is logged in");
|
|
57
|
+
}
|
|
58
|
+
if (!connectionId) {
|
|
59
|
+
throw new Error("No connection ID was provided");
|
|
60
|
+
}
|
|
61
|
+
return [4 /*yield*/, axios.delete("/connections/".concat(connectionId), { withCredentials: true })];
|
|
62
|
+
case 1:
|
|
63
|
+
response = _a.sent();
|
|
64
|
+
return [2 /*return*/, response.data];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}); }, [axios, projectId, user]);
|
|
68
|
+
return removeConnection;
|
|
69
|
+
}
|
|
70
|
+
export default useRemoveConnection;
|
|
71
|
+
//# sourceMappingURL=useRemoveConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRemoveConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,SAAS,mBAAmB;IAA5B,iBA+BC;IA9BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,gBAAgB,GAAG,WAAW,CAClC,UAAO,KAA+B;;;;;oBAC5B,YAAY,GAAK,KAAK,aAAV,CAAW;oBAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,YAAY,EAAE,CAAC;wBAClB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,uBAAgB,YAAY,CAAE,EAC9B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAkC,EAAC;;;SACpD,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
+
import useProject from "../../projects/useProject";
|
|
40
|
+
import { useUser } from "../../user";
|
|
41
|
+
function useRemoveConnectionByUserId() {
|
|
42
|
+
var _this = this;
|
|
43
|
+
var axios = useAxiosPrivate();
|
|
44
|
+
var projectId = useProject().projectId;
|
|
45
|
+
var user = useUser().user;
|
|
46
|
+
var removeConnectionByUserId = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
+
var userId, response;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
userId = props.userId;
|
|
52
|
+
if (!projectId) {
|
|
53
|
+
throw new Error("No project specified");
|
|
54
|
+
}
|
|
55
|
+
if (!user) {
|
|
56
|
+
throw new Error("No user is logged in");
|
|
57
|
+
}
|
|
58
|
+
if (!userId) {
|
|
59
|
+
throw new Error("No user ID was provided");
|
|
60
|
+
}
|
|
61
|
+
if (userId === user.id) {
|
|
62
|
+
throw new Error("Cannot disconnect from yourself");
|
|
63
|
+
}
|
|
64
|
+
return [4 /*yield*/, axios.delete("/users/".concat(userId, "/connection"), { withCredentials: true })];
|
|
65
|
+
case 1:
|
|
66
|
+
response = _a.sent();
|
|
67
|
+
return [2 /*return*/, response.data];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}); }, [axios, projectId, user]);
|
|
71
|
+
return removeConnectionByUserId;
|
|
72
|
+
}
|
|
73
|
+
export default useRemoveConnectionByUserId;
|
|
74
|
+
//# sourceMappingURL=useRemoveConnectionByUserId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRemoveConnectionByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRemoveConnectionByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,SAAS,2BAA2B;IAApC,iBAmCC;IAlCC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,wBAAwB,GAAG,WAAW,CAC1C,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;oBACrD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,MAAM,CACjC,iBAAU,MAAM,gBAAa,EAC7B,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAwC,EAAC;;;SAC1D,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,eAAe,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
+
import useProject from "../../projects/useProject";
|
|
40
|
+
function useRequestConnection() {
|
|
41
|
+
var _this = this;
|
|
42
|
+
var axios = useAxiosPrivate();
|
|
43
|
+
var projectId = useProject().projectId;
|
|
44
|
+
var requestConnection = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
45
|
+
var userId, message, response;
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
switch (_a.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
userId = props.userId, message = props.message;
|
|
50
|
+
if (!projectId) {
|
|
51
|
+
throw new Error("No project specified");
|
|
52
|
+
}
|
|
53
|
+
if (!userId) {
|
|
54
|
+
throw new Error("No user ID was provided");
|
|
55
|
+
}
|
|
56
|
+
return [4 /*yield*/, axios.post("/users/".concat(userId, "/connection"), { message: message }, { withCredentials: true })];
|
|
57
|
+
case 1:
|
|
58
|
+
response = _a.sent();
|
|
59
|
+
return [2 /*return*/, response.data];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); }, [axios, projectId]);
|
|
63
|
+
return requestConnection;
|
|
64
|
+
}
|
|
65
|
+
export default useRequestConnection;
|
|
66
|
+
//# sourceMappingURL=useRequestConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRequestConnection.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/connections/useRequestConnection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAGnD,SAAS,oBAAoB;IAA7B,iBA2BC;IA1BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,iBAAiB,GAAG,WAAW,CACnC,UAAO,KAA8B;;;;;oBAC3B,MAAM,GAAc,KAAK,OAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;oBAClC,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,IAAI,CAC/B,iBAAU,MAAM,gBAAa,EAC7B,EAAE,OAAO,SAAA,EAAE,EACX,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAJK,QAAQ,GAAG,SAIhB;oBAED,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
1
|
+
export { default as useFetchFollowStatus } from "./useFetchFollowStatus";
|
|
2
|
+
export { default as useFetchFollowers } from "./useFetchFollowers";
|
|
3
|
+
export { default as useFetchFollowersByUserId } from "./useFetchFollowersByUserId";
|
|
4
|
+
export { default as useFetchFollowersCount } from "./useFetchFollowersCount";
|
|
5
|
+
export { default as useFetchFollowersCountByUserId } from "./useFetchFollowersCountByUserId";
|
|
6
|
+
export { default as useFetchFollowing } from "./useFetchFollowing";
|
|
7
|
+
export { default as useFetchFollowingByUserId } from "./useFetchFollowingByUserId";
|
|
8
|
+
export { default as useFetchFollowingCount } from "./useFetchFollowingCount";
|
|
9
|
+
export { default as useFetchFollowingCountByUserId } from "./useFetchFollowingCountByUserId";
|
|
4
10
|
export { default as useFollowManager } from "./useFollowManager";
|
|
11
|
+
export { default as useFollowUser } from "./useFollowUser";
|
|
12
|
+
export { default as useUnfollowByFollowId } from "./useUnfollowByFollowId";
|
|
13
|
+
export { default as useUnfollowUserByUserId } from "./useUnfollowUserByUserId";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
1
|
+
export { default as useFetchFollowStatus } from "./useFetchFollowStatus";
|
|
2
|
+
export { default as useFetchFollowers } from "./useFetchFollowers";
|
|
3
|
+
export { default as useFetchFollowersByUserId } from "./useFetchFollowersByUserId";
|
|
4
|
+
export { default as useFetchFollowersCount } from "./useFetchFollowersCount";
|
|
5
|
+
export { default as useFetchFollowersCountByUserId } from "./useFetchFollowersCountByUserId";
|
|
6
|
+
export { default as useFetchFollowing } from "./useFetchFollowing";
|
|
7
|
+
export { default as useFetchFollowingByUserId } from "./useFetchFollowingByUserId";
|
|
8
|
+
export { default as useFetchFollowingCount } from "./useFetchFollowingCount";
|
|
9
|
+
export { default as useFetchFollowingCountByUserId } from "./useFetchFollowingCountByUserId";
|
|
4
10
|
export { default as useFollowManager } from "./useFollowManager";
|
|
11
|
+
export { default as useFollowUser } from "./useFollowUser";
|
|
12
|
+
export { default as useUnfollowByFollowId } from "./useUnfollowByFollowId";
|
|
13
|
+
export { default as useUnfollowUserByUserId } from "./useUnfollowUserByUserId";
|
|
5
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -38,12 +38,12 @@ import { useCallback } from "react";
|
|
|
38
38
|
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
39
|
import useProject from "../../projects/useProject";
|
|
40
40
|
import { useUser } from "../../user";
|
|
41
|
-
function
|
|
41
|
+
function useFetchFollowStatus() {
|
|
42
42
|
var _this = this;
|
|
43
43
|
var axios = useAxiosPrivate();
|
|
44
44
|
var projectId = useProject().projectId;
|
|
45
45
|
var user = useUser().user;
|
|
46
|
-
var
|
|
46
|
+
var fetchFollowStatus = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
47
47
|
var userId, response;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
@@ -70,7 +70,7 @@ function useFetchFollow() {
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}); }, [axios, projectId, user]);
|
|
73
|
-
return
|
|
73
|
+
return fetchFollowStatus;
|
|
74
74
|
}
|
|
75
|
-
export default
|
|
76
|
-
//# sourceMappingURL=
|
|
75
|
+
export default useFetchFollowStatus;
|
|
76
|
+
//# sourceMappingURL=useFetchFollowStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchFollowStatus.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowStatus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,SAAS,oBAAoB;IAA7B,iBAqCC;IApCC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,iBAAiB,GAAG,WAAW,CACnC,UAAO,KAAyB;;;;;oBACtB,MAAM,GAAK,KAAK,OAAV,CAAW;oBACzB,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;oBAC1C,CAAC;oBAED,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,MAAM,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;wBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;oBACnD,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,oBAAU,MAAM,YAAS,EAAE;4BACvE,eAAe,EAAE,IAAI;yBACtB,CAAC,EAAA;;oBAFI,QAAQ,GAAG,SAEf;oBACF,sBAAO,QAAQ,CAAC,IAIf,EAAC;;;SACH,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { User } from "../../../interfaces/models/User";
|
|
2
|
+
export interface FollowerWithFollowInfo {
|
|
3
|
+
followId: string;
|
|
4
|
+
user: User;
|
|
5
|
+
followedAt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FollowersResponse {
|
|
8
|
+
followers: FollowerWithFollowInfo[];
|
|
9
|
+
pagination: {
|
|
10
|
+
currentPage: number;
|
|
11
|
+
totalPages: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
hasPreviousPage: boolean;
|
|
15
|
+
limit: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FetchFollowersParams {
|
|
19
|
+
page?: number;
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
declare function useFetchFollowers(): ({ page, limit }?: FetchFollowersParams) => Promise<FollowersResponse>;
|
|
23
|
+
export default useFetchFollowers;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
import { useCallback } from "react";
|
|
47
|
+
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
48
|
+
import useProject from "../../projects/useProject";
|
|
49
|
+
import { useUser } from "../../user";
|
|
50
|
+
function useFetchFollowers() {
|
|
51
|
+
var _this = this;
|
|
52
|
+
var axios = useAxiosPrivate();
|
|
53
|
+
var projectId = useProject().projectId;
|
|
54
|
+
var user = useUser().user;
|
|
55
|
+
var fetchFollowers = useCallback(function () {
|
|
56
|
+
var args_1 = [];
|
|
57
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
58
|
+
args_1[_i] = arguments[_i];
|
|
59
|
+
}
|
|
60
|
+
return __awaiter(_this, __spreadArray([], args_1, true), void 0, function (_a) {
|
|
61
|
+
var response;
|
|
62
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.limit, limit = _d === void 0 ? 20 : _d;
|
|
63
|
+
return __generator(this, function (_e) {
|
|
64
|
+
switch (_e.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
if (!projectId) {
|
|
67
|
+
throw new Error("No projectId available.");
|
|
68
|
+
}
|
|
69
|
+
if (!user) {
|
|
70
|
+
throw new Error("No user is logged in.");
|
|
71
|
+
}
|
|
72
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/follows/followers"), {
|
|
73
|
+
params: { page: page, limit: limit },
|
|
74
|
+
withCredentials: true,
|
|
75
|
+
})];
|
|
76
|
+
case 1:
|
|
77
|
+
response = _e.sent();
|
|
78
|
+
return [2 /*return*/, response.data];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}, [axios, projectId, user]);
|
|
83
|
+
return fetchFollowers;
|
|
84
|
+
}
|
|
85
|
+
export default useFetchFollowers;
|
|
86
|
+
//# sourceMappingURL=useFetchFollowers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchFollowers.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowers.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA0BrC,SAAS,iBAAiB;IAA1B,iBA0BC;IAzBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,cAAc,GAAG,WAAW,CAChC;;;;;mFAAO,EAAmD;;gBAAnD,qBAAiD,EAAE,KAAA,EAAjD,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA;;;;wBAC3B,IAAI,CAAC,SAAS,EAAE,CAAC;4BACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;wBAC7C,CAAC;wBAED,IAAI,CAAC,IAAI,EAAE,CAAC;4BACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;wBAC3C,CAAC;wBAEgB,qBAAM,KAAK,CAAC,GAAG,CAAC,WAAI,SAAS,uBAAoB,EAAE;gCAClE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE;gCACvB,eAAe,EAAE,IAAI;6BACtB,CAAC,EAAA;;wBAHI,QAAQ,GAAG,SAGf;wBAEF,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;;KAC3C,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { User } from "../../../interfaces/models/User";
|
|
2
|
+
export interface FollowerWithFollowInfo {
|
|
3
|
+
followId: string;
|
|
4
|
+
user: User;
|
|
5
|
+
followedAt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FollowersResponse {
|
|
8
|
+
followers: FollowerWithFollowInfo[];
|
|
9
|
+
pagination: {
|
|
10
|
+
currentPage: number;
|
|
11
|
+
totalPages: number;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
hasPreviousPage: boolean;
|
|
15
|
+
limit: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FetchFollowersByUserIdParams {
|
|
19
|
+
userId: string;
|
|
20
|
+
page?: number;
|
|
21
|
+
limit?: number;
|
|
22
|
+
}
|
|
23
|
+
declare function useFetchFollowersByUserId(): ({ userId, page, limit }: FetchFollowersByUserIdParams) => Promise<FollowersResponse>;
|
|
24
|
+
export default useFetchFollowersByUserId;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import useProject from "../../projects/useProject";
|
|
39
|
+
import axios from "../../../config/axios";
|
|
40
|
+
function useFetchFollowersByUserId() {
|
|
41
|
+
var _this = this;
|
|
42
|
+
var projectId = useProject().projectId;
|
|
43
|
+
var fetchFollowersByUserId = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
44
|
+
var response;
|
|
45
|
+
var userId = _b.userId, _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.limit, limit = _d === void 0 ? 20 : _d;
|
|
46
|
+
return __generator(this, function (_e) {
|
|
47
|
+
switch (_e.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
if (!userId) {
|
|
50
|
+
throw new Error("No userId provided.");
|
|
51
|
+
}
|
|
52
|
+
if (!projectId) {
|
|
53
|
+
throw new Error("No projectId available.");
|
|
54
|
+
}
|
|
55
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/users/").concat(userId, "/followers"), { params: { page: page, limit: limit } })];
|
|
56
|
+
case 1:
|
|
57
|
+
response = _e.sent();
|
|
58
|
+
return [2 /*return*/, response.data];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}); }, [projectId]);
|
|
62
|
+
return fetchFollowersByUserId;
|
|
63
|
+
}
|
|
64
|
+
export default useFetchFollowersByUserId;
|
|
65
|
+
//# sourceMappingURL=useFetchFollowersByUserId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchFollowersByUserId.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowersByUserId.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AAEnD,OAAO,KAAK,MAAM,uBAAuB,CAAC;AA0B1C,SAAS,yBAAyB;IAAlC,iBAwBC;IAvBS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,sBAAsB,GAAG,WAAW,CACxC,gEAAO,EAA8D;;YAA5D,MAAM,YAAA,EAAE,YAAQ,EAAR,IAAI,mBAAG,CAAC,KAAA,EAAE,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA;;;;oBACnC,IAAI,CAAC,MAAM,EAAE,CAAC;wBACZ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;oBACzC,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,oBAAU,MAAM,eAAY,EACzC,EAAE,MAAM,EAAE,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CAC5B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from "react";
|
|
38
|
+
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
+
import useProject from "../../projects/useProject";
|
|
40
|
+
import { useUser } from "../../user";
|
|
41
|
+
function useFetchFollowersCount() {
|
|
42
|
+
var _this = this;
|
|
43
|
+
var axios = useAxiosPrivate();
|
|
44
|
+
var projectId = useProject().projectId;
|
|
45
|
+
var user = useUser().user;
|
|
46
|
+
var fetchFollowersCount = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
+
var response;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
if (!projectId) {
|
|
52
|
+
throw new Error("No projectId available.");
|
|
53
|
+
}
|
|
54
|
+
if (!user) {
|
|
55
|
+
throw new Error("No user is logged in.");
|
|
56
|
+
}
|
|
57
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/follows/followers-count"), { withCredentials: true })];
|
|
58
|
+
case 1:
|
|
59
|
+
response = _a.sent();
|
|
60
|
+
return [2 /*return*/, response.data];
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}); }, [axios, projectId, user]);
|
|
64
|
+
return fetchFollowersCount;
|
|
65
|
+
}
|
|
66
|
+
export default useFetchFollowersCount;
|
|
67
|
+
//# sourceMappingURL=useFetchFollowersCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchFollowersCount.js","sourceRoot":"","sources":["../../../../../src/hooks/relationships/follows/useFetchFollowersCount.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,SAAS,sBAAsB;IAA/B,iBA0BC;IAzBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,OAAO,EAAE,KAAd,CAAe;IAE3B,IAAM,mBAAmB,GAAG,WAAW,CACrC;;;;;oBACE,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAED,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,6BAA0B,EACvC,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAyB,EAAC;;;SAC3C,EACD,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,eAAe,sBAAsB,CAAC"}
|