@ludo.ninja/components 1.5.9 → 1.6.0
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/hooks/apollo/index.d.ts +2 -1
- package/dist/hooks/apollo/index.jsx +7 -1
- package/dist/hooks/searchFiltersConnector/index.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/api/graphql/index.d.ts +0 -4
- package/dist/api/graphql/index.js +0 -7
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/server-assets/mutations/useDislikeAsset/index.d.ts +0 -7
- package/dist/api/server-assets/mutations/useDislikeAsset/index.js +0 -79
- package/dist/api/server-assets/mutations/useLikeAsset/index.d.ts +0 -7
- package/dist/api/server-assets/mutations/useLikeAsset/index.js +0 -80
- package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.d.ts +0 -14
- package/dist/api/server-assets/queries/useFetchAssetByBlockchain/index.js +0 -84
- package/dist/api/server-assets/queries/useFetchAssets/index.d.ts +0 -7
- package/dist/api/server-assets/queries/useFetchAssets/index.js +0 -30
- package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.d.ts +0 -8
- package/dist/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +0 -35
- package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.d.ts +0 -7
- package/dist/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +0 -30
- package/dist/api/server-collection/mutations/useDislikeCollection/index.d.ts +0 -7
- package/dist/api/server-collection/mutations/useDislikeCollection/index.js +0 -78
- package/dist/api/server-collection/mutations/useLikeCollection/index.d.ts +0 -7
- package/dist/api/server-collection/mutations/useLikeCollection/index.js +0 -78
- package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.d.ts +0 -2
- package/dist/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +0 -91
- package/dist/api/server-experiences/queries/useFetchMyTasks/index.d.ts +0 -31
- package/dist/api/server-experiences/queries/useFetchMyTasks/index.js +0 -46
- package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddAssetsToGallery/index.js +0 -82
- package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.d.ts +0 -4
- package/dist/api/server-galleries/mutations/useAddChangeGalleryBanner/index.js +0 -67
- package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddCollectionsToGallery/index.js +0 -81
- package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useAddCreationsToGallery/index.js +0 -89
- package/dist/api/server-galleries/mutations/useCreateFavorites/index.d.ts +0 -6
- package/dist/api/server-galleries/mutations/useCreateFavorites/index.js +0 -70
- package/dist/api/server-galleries/mutations/useCreateGallery/index.d.ts +0 -6
- package/dist/api/server-galleries/mutations/useCreateGallery/index.js +0 -70
- package/dist/api/server-galleries/mutations/useDeleteGallery/index.d.ts +0 -8
- package/dist/api/server-galleries/mutations/useDeleteGallery/index.js +0 -87
- package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.d.ts +0 -5
- package/dist/api/server-galleries/mutations/useDeleteGalleryBanner/index.js +0 -83
- package/dist/api/server-galleries/mutations/useEditGallery/index.d.ts +0 -5
- package/dist/api/server-galleries/mutations/useEditGallery/index.js +0 -62
- package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +0 -95
- package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.d.ts +0 -7
- package/dist/api/server-galleries/mutations/useRemoveCollectionFromGallery/index.js +0 -90
- package/dist/api/server-galleries/queries/useFetchGallery/index.d.ts +0 -16
- package/dist/api/server-galleries/queries/useFetchGallery/index.js +0 -42
- package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.d.ts +0 -18
- package/dist/api/server-galleries/queries/useFetchGalleryAssets/index.js +0 -115
- package/dist/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +0 -10
- package/dist/api/server-galleries/queries/useFetchMyFavorites/index.js +0 -120
- package/dist/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +0 -10
- package/dist/api/server-galleries/queries/useFetchMyGalleries/index.js +0 -123
- package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.d.ts +0 -9
- package/dist/api/server-galleries/queries/useFetchSubscribedGalleries/index.js +0 -95
- package/dist/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +0 -11
- package/dist/api/server-galleries/queries/useFetchUserFavorites/index.js +0 -130
- package/dist/api/server-identities/mutations/useAddWalletElrond/index.d.ts +0 -6
- package/dist/api/server-identities/mutations/useAddWalletElrond/index.js +0 -37
- package/dist/api/server-identities/mutations/useAddWalletFlow/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletFlow/index.js +0 -78
- package/dist/api/server-identities/mutations/useAddWalletMetamask/index.d.ts +0 -12
- package/dist/api/server-identities/mutations/useAddWalletMetamask/index.js +0 -87
- package/dist/api/server-identities/mutations/useAddWalletSolana/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletSolana/index.js +0 -82
- package/dist/api/server-identities/mutations/useAddWalletTezos/index.d.ts +0 -5
- package/dist/api/server-identities/mutations/useAddWalletTezos/index.js +0 -78
- package/dist/api/server-identities/mutations/useFollowProfile/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useFollowProfile/index.js +0 -40
- package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useGenerateNewInviteCodes/index.js +0 -78
- package/dist/api/server-identities/mutations/useInviteCode/index.d.ts +0 -9
- package/dist/api/server-identities/mutations/useInviteCode/index.js +0 -76
- package/dist/api/server-identities/mutations/useRemoveWallet/index.d.ts +0 -8
- package/dist/api/server-identities/mutations/useRemoveWallet/index.js +0 -44
- package/dist/api/server-identities/mutations/useRevokeToken/index.d.ts +0 -4
- package/dist/api/server-identities/mutations/useRevokeToken/index.js +0 -66
- package/dist/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +0 -76
- package/dist/api/server-identities/mutations/useUnfollowProfile/index.d.ts +0 -7
- package/dist/api/server-identities/mutations/useUnfollowProfile/index.js +0 -39
- package/dist/api/server-identities/queries/useFetchProfile/index.d.ts +0 -16
- package/dist/api/server-identities/queries/useFetchProfile/index.js +0 -79
- package/dist/api/server-identities/queries/useFetchUserWallets/index.js +0 -19
- package/dist/api/server-identities/queries/useGetMyInviteCodes/index.d.ts +0 -8
- package/dist/api/server-identities/queries/useGetMyInviteCodes/index.js +0 -36
- package/dist/api/server-medias/mutations/useDeleteUserpic/index.d.ts +0 -6
- package/dist/api/server-medias/mutations/useDeleteUserpic/index.js +0 -19
- package/dist/api/server-medias/mutations/useUploadUserpic/index.d.ts +0 -4
- package/dist/api/server-medias/mutations/useUploadUserpic/index.js +0 -69
- package/dist/api/server-medias/queries/useFetchUserPic/index.js +0 -37
- package/dist/api/server-opportunities/mutations/useDislikeOpportunity.d.ts +0 -4
- package/dist/api/server-opportunities/mutations/useDislikeOpportunity.js +0 -71
- package/dist/api/server-opportunities/mutations/useLikeOpportunity.d.ts +0 -4
- package/dist/api/server-opportunities/mutations/useLikeOpportunity.js +0 -71
- package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.d.ts +0 -5
- package/dist/api/server-opportunities/mutations/useOpenOpportunity/index.js +0 -72
- package/dist/api/server-opportunities/queries/useGetOpportunities.d.ts +0 -4
- package/dist/api/server-opportunities/queries/useGetOpportunities.js +0 -22
- package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.d.ts +0 -4
- package/dist/api/server-preferences/mutations/useSaveUserExpectations/index.jsx +0 -86
- package/dist/api/server-preferences/mutations/useSaveUserInterests/index.d.ts +0 -4
- package/dist/api/server-preferences/mutations/useSaveUserInterests/index.js +0 -86
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/index.js +0 -28
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.d.ts +0 -14
- package/dist/api/server-preferences/queries/fetchSearchResultSelections/queryData.js +0 -87
- package/dist/api/server-preferences/queries/useFetchExpectations/index.js +0 -19
- package/dist/api/server-preferences/queries/useFetchInterests/index.js +0 -19
- package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.d.ts +0 -12
- package/dist/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.js +0 -36
- package/dist/api/server-preferences/queries/useFetchUserInterests/index.d.ts +0 -7
- package/dist/api/server-preferences/queries/useFetchUserInterests/index.js +0 -20
- package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultBlockchainSelections/index.js +0 -37
- package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultCategorySelections/index.js +0 -37
- package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.d.ts +0 -14
- package/dist/api/server-preferences/queries/useSearchResultStatusSelections/index.js +0 -38
- package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.d.ts +0 -13
- package/dist/api/server-preferences/queries/useSearchResultTypeSelections/index.js +0 -42
- package/dist/api/server-search/queries/useFetchAllCreations/index.js +0 -171
- package/dist/api/server-search/queries/useFetchAssetsCount/index.d.ts +0 -7
- package/dist/api/server-search/queries/useFetchAssetsCount/index.js +0 -31
- package/dist/api/server-search/queries/useFetchCollection/index.d.ts +0 -19
- package/dist/api/server-search/queries/useFetchCollection/index.js +0 -55
- package/dist/api/server-search/queries/useFetchCollections/index.d.ts +0 -23
- package/dist/api/server-search/queries/useFetchCollections/index.js +0 -176
- package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +0 -13
- package/dist/api/server-search/queries/useFetchDynamicCollectionData/index.js +0 -195
- package/dist/api/server-search/queries/useFetchFindAllTopEntitiesByName/index.js +0 -54
- package/dist/api/server-search/queries/useFetchNetWorth/index.d.ts +0 -7
- package/dist/api/server-search/queries/useFetchNetWorth/index.js +0 -22
- package/dist/api/server-search/queries/useFindCreations/index.js +0 -184
- package/dist/api/server-search/queries/useFindProfilesByName/index.js +0 -58
- package/dist/api/server-search/queries/useFindShowcaseItems/index.d.ts +0 -2
- package/dist/api/server-search/queries/useFindShowcaseItems/index.js +0 -40
- package/dist/api/server-search/queries/useFindUserCreations/index.js +0 -168
- package/dist/api/server-search/queries/useFindUserShowcaseItems/index.d.ts +0 -2
- package/dist/api/server-search/queries/useFindUserShowcaseItems/index.js +0 -38
- package/dist/api/subscriptions/SubscriberInviteNotification.d.ts +0 -2
- package/dist/api/subscriptions/SubscriberInviteNotification.jsx +0 -40
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
13
|
-
import { alertError } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
14
|
-
import { useUiStore } from '@/store/ui';
|
|
15
|
-
var useRemoveWallet = function (_a) {
|
|
16
|
-
var userId = _a.userId;
|
|
17
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
18
|
-
var _b = schema.useRemoveWalletMutation({
|
|
19
|
-
context: {
|
|
20
|
-
uri: hosts.identityHost,
|
|
21
|
-
},
|
|
22
|
-
refetchQueries: [
|
|
23
|
-
{
|
|
24
|
-
query: schema.FetchUserWalletsDocument,
|
|
25
|
-
fetchPolicy: 'no-cache',
|
|
26
|
-
context: {
|
|
27
|
-
uri: hosts.identityHost,
|
|
28
|
-
},
|
|
29
|
-
variables: { userId: userId },
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
onError: function (err) {
|
|
33
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
34
|
-
},
|
|
35
|
-
}), mutate = _b[0], error = _b[1].error;
|
|
36
|
-
return { removeWallet: removeWallet, error: error };
|
|
37
|
-
function removeWallet(_a) {
|
|
38
|
-
var blockchain = _a.blockchain, address = _a.address, chainId = _a.chainId;
|
|
39
|
-
return mutate({
|
|
40
|
-
variables: { blockchain: blockchain, address: address, chainId: chainId },
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
export default useRemoveWallet;
|
|
@@ -1,66 +0,0 @@
|
|
|
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;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "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 { useMutation } from '@apollo/client';
|
|
38
|
-
import { hosts, authSchema as schema } from '@ludo.ninja/api';
|
|
39
|
-
var useRevokeToken = function () {
|
|
40
|
-
var mutate = useMutation(schema.RevokeTokenDocument, {
|
|
41
|
-
context: {
|
|
42
|
-
uri: hosts.authHost,
|
|
43
|
-
},
|
|
44
|
-
})[0];
|
|
45
|
-
return { revokeToken: revokeToken };
|
|
46
|
-
function revokeToken() {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
-
var err_1;
|
|
49
|
-
return __generator(this, function (_a) {
|
|
50
|
-
switch (_a.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
_a.trys.push([0, 2, , 3]);
|
|
53
|
-
return [4 /*yield*/, mutate()];
|
|
54
|
-
case 1:
|
|
55
|
-
_a.sent();
|
|
56
|
-
return [3 /*break*/, 3];
|
|
57
|
-
case 2:
|
|
58
|
-
err_1 = _a.sent();
|
|
59
|
-
throw new Error(err_1);
|
|
60
|
-
case 3: return [2 /*return*/];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
export default useRevokeToken;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
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;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
49
|
-
import { alertError, alertSuccess, } from '@ludo.ninja/ui/build/system/Alert/data';
|
|
50
|
-
import { useUiStore } from '@/store/ui';
|
|
51
|
-
var useSaveEmailOfJoiner = function () {
|
|
52
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
53
|
-
var _a = schema.useSaveEmailOfJoinerMutation({
|
|
54
|
-
context: {
|
|
55
|
-
uri: hosts.identityHost,
|
|
56
|
-
},
|
|
57
|
-
onCompleted: function () {
|
|
58
|
-
openAlert(__assign(__assign({}, alertSuccess), { caption: 'Success!', text: 'You subscribed' }));
|
|
59
|
-
},
|
|
60
|
-
onError: function (err) {
|
|
61
|
-
openAlert(__assign(__assign({}, alertError), { caption: err.message, text: '' }));
|
|
62
|
-
},
|
|
63
|
-
}), mutate = _a[0], _b = _a[1], error = _b.error, loading = _b.loading;
|
|
64
|
-
return { saveEmailOfJoiner: saveEmailOfJoiner, error: error, loading: loading };
|
|
65
|
-
function saveEmailOfJoiner(_a) {
|
|
66
|
-
var email = _a.email, isSubscribed = _a.isSubscribed;
|
|
67
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
return __generator(this, function (_b) {
|
|
69
|
-
return [2 /*return*/, mutate({
|
|
70
|
-
variables: { email: email, isSubscribed: isSubscribed },
|
|
71
|
-
})];
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
export default useSaveEmailOfJoiner;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const useUnfollowProfile: (followingUserId: string) => {
|
|
2
|
-
unfollowProfile: (options?: import("@apollo/client").MutationFunctionOptions<any, import("@apollo/client").OperationVariables, {
|
|
3
|
-
uri: string;
|
|
4
|
-
}, import("@apollo/client").ApolloCache<any>>) => Promise<import("@apollo/client").FetchResult<any>>;
|
|
5
|
-
isUnFollowedProfile: boolean;
|
|
6
|
-
};
|
|
7
|
-
export default useUnfollowProfile;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
import { gql, useMutation } from '@apollo/client';
|
|
7
|
-
import { hosts } from '@ludo.ninja/api';
|
|
8
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
9
|
-
import { useUiStore } from '@/store/ui';
|
|
10
|
-
var UNFOLLOW_PROFILE_MUTATION = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation UnfollowProfile($followingUserId: ID!) {\n unfollowProfile(followingUserId: $followingUserId)\n }\n"], ["\n mutation UnfollowProfile($followingUserId: ID!) {\n unfollowProfile(followingUserId: $followingUserId)\n }\n"])));
|
|
11
|
-
var useUnfollowProfile = function (followingUserId) {
|
|
12
|
-
var _a = useState(false), isUnFollowedProfile = _a[0], setIsUnFollowed = _a[1];
|
|
13
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
14
|
-
var unfollowProfile = useMutation(UNFOLLOW_PROFILE_MUTATION, {
|
|
15
|
-
variables: { followingUserId: followingUserId },
|
|
16
|
-
context: {
|
|
17
|
-
uri: hosts.identityHost,
|
|
18
|
-
},
|
|
19
|
-
onCompleted: function (_a) {
|
|
20
|
-
var unfollowProfile = _a.unfollowProfile;
|
|
21
|
-
setIsUnFollowed(unfollowProfile);
|
|
22
|
-
openAlert({
|
|
23
|
-
type: alertVariants.success,
|
|
24
|
-
caption: 'You successfully unsubscribed!',
|
|
25
|
-
text: '',
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
onError: function (err) {
|
|
29
|
-
openAlert({
|
|
30
|
-
type: alertVariants.error,
|
|
31
|
-
caption: err.message,
|
|
32
|
-
});
|
|
33
|
-
setIsUnFollowed(false);
|
|
34
|
-
},
|
|
35
|
-
})[0];
|
|
36
|
-
return { unfollowProfile: unfollowProfile, isUnFollowedProfile: isUnFollowedProfile };
|
|
37
|
-
};
|
|
38
|
-
export default useUnfollowProfile;
|
|
39
|
-
var templateObject_1;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
import { ProfileEntity } from '@ludo.ninja/core';
|
|
4
|
-
declare const prefetchProfile: ({ userId }: schema.IQueryFetchProfileArgs, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
5
|
-
data: {
|
|
6
|
-
fetchProfile: any;
|
|
7
|
-
};
|
|
8
|
-
}>;
|
|
9
|
-
declare const useFetchProfile: ({ userId }: schema.IQueryFetchProfileArgs, prefetchedProfile: ProfileEntity | null) => {
|
|
10
|
-
refetch: (variables?: Partial<import("@apollo/client").OperationVariables>) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
|
|
11
|
-
data: any;
|
|
12
|
-
clientProfileData: ProfileEntity;
|
|
13
|
-
clientProfileLoading: boolean;
|
|
14
|
-
clientProfileError: import("@apollo/client").ApolloError;
|
|
15
|
-
};
|
|
16
|
-
export { prefetchProfile, useFetchProfile };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { useLazyQuery, } from '@apollo/client';
|
|
3
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
4
|
-
import { ProfileEntity } from '@ludo.ninja/core';
|
|
5
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
6
|
-
import { useUserStore } from '@/modules/user/store';
|
|
7
|
-
import { useUiStore } from '@/store/ui';
|
|
8
|
-
var prefetchProfile = function (_a, apolloClient) {
|
|
9
|
-
var userId = _a.userId;
|
|
10
|
-
return apolloClient
|
|
11
|
-
.query({
|
|
12
|
-
query: schema.FetchProfileDocument,
|
|
13
|
-
variables: { userId: userId },
|
|
14
|
-
context: { uri: hosts.serverIdentityHost },
|
|
15
|
-
fetchPolicy: 'network-only',
|
|
16
|
-
})
|
|
17
|
-
.catch(function () {
|
|
18
|
-
return {
|
|
19
|
-
data: { fetchProfile: null },
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var useFetchProfile = function (_a, prefetchedProfile) {
|
|
24
|
-
var userId = _a.userId;
|
|
25
|
-
var _b = useState(prefetchedProfile), profile = _b[0], setProfile = _b[1];
|
|
26
|
-
var _c = useState(false), isLoading = _c[0], setIsLoading = _c[1];
|
|
27
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
28
|
-
var _d = useUserStore(function (state) { return ({
|
|
29
|
-
profileData: state.profileData,
|
|
30
|
-
isLoadingProfileData: state.isLoadingProfileData,
|
|
31
|
-
user: state.user,
|
|
32
|
-
}); }), profileData = _d.profileData, isLoadingProfileData = _d.isLoadingProfileData, user = _d.user;
|
|
33
|
-
var _e = useLazyQuery(schema.FetchProfileDocument, {
|
|
34
|
-
variables: { userId: userId },
|
|
35
|
-
context: {
|
|
36
|
-
uri: hosts.identityHost,
|
|
37
|
-
},
|
|
38
|
-
onCompleted: function (_a) {
|
|
39
|
-
var fetchProfile = _a.fetchProfile;
|
|
40
|
-
setProfile(new ProfileEntity(fetchProfile));
|
|
41
|
-
setIsLoading(false);
|
|
42
|
-
},
|
|
43
|
-
onError: function (err) {
|
|
44
|
-
openAlert({
|
|
45
|
-
type: alertVariants.error,
|
|
46
|
-
caption: err.message,
|
|
47
|
-
});
|
|
48
|
-
setProfile(null);
|
|
49
|
-
setIsLoading(false);
|
|
50
|
-
},
|
|
51
|
-
}), fetchProfile = _e[0], _f = _e[1], data = _f.data, error = _f.error, refetch = _f.refetch;
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
if (!prefetchedProfile) {
|
|
54
|
-
if (userId === (user === null || user === void 0 ? void 0 : user.userId)) {
|
|
55
|
-
if (!isLoadingProfileData && !profileData) {
|
|
56
|
-
setProfile(null);
|
|
57
|
-
setIsLoading(true);
|
|
58
|
-
fetchProfile();
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
setProfile(profileData);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
setProfile(null);
|
|
66
|
-
setIsLoading(true);
|
|
67
|
-
fetchProfile();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, [isLoadingProfileData, profileData, userId]);
|
|
71
|
-
return {
|
|
72
|
-
refetch: refetch,
|
|
73
|
-
data: data,
|
|
74
|
-
clientProfileData: profile,
|
|
75
|
-
clientProfileLoading: isLoading,
|
|
76
|
-
clientProfileError: error,
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export { prefetchProfile, useFetchProfile };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
var useFetchUserWallets = function (_a) {
|
|
3
|
-
var _b;
|
|
4
|
-
var userId = _a.userId;
|
|
5
|
-
var _c = schema.useFetchUserWalletsQuery({
|
|
6
|
-
variables: { userId: userId },
|
|
7
|
-
context: {
|
|
8
|
-
uri: hosts.identityHost,
|
|
9
|
-
},
|
|
10
|
-
}), loading = _c.loading, error = _c.error, data = _c.data;
|
|
11
|
-
return {
|
|
12
|
-
loading: loading,
|
|
13
|
-
error: error,
|
|
14
|
-
userWallets: ((_b = data === null || data === void 0 ? void 0 : data.fetchUserWallets) === null || _b === void 0 ? void 0 : _b.slice().sort(function (wallet, nextWallet) {
|
|
15
|
-
return Number(nextWallet === null || nextWallet === void 0 ? void 0 : nextWallet.mainWallet) - Number(wallet === null || wallet === void 0 ? void 0 : wallet.mainWallet);
|
|
16
|
-
})) || null,
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default useFetchUserWallets;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useGetMyInviteCodes: () => {
|
|
3
|
-
myInviteCodes: schema.IUserInviteCode[];
|
|
4
|
-
loadMyInviteCodes: () => void;
|
|
5
|
-
loadingMyInviteCodes: boolean;
|
|
6
|
-
errorMyInviteCodes: import("@apollo/client").ApolloError;
|
|
7
|
-
};
|
|
8
|
-
export { useGetMyInviteCodes };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { useLazyQuery } from '@apollo/client';
|
|
3
|
-
import { hosts, identitySchema as schema } from '@ludo.ninja/api';
|
|
4
|
-
import { useUserStore } from '@/modules/user/store';
|
|
5
|
-
var useGetMyInviteCodes = function () {
|
|
6
|
-
var _a = useState(), myInviteCodes = _a[0], setMyInviteCodes = _a[1];
|
|
7
|
-
var inviteCodes = useUserStore(function (state) { return ({
|
|
8
|
-
inviteCodes: state.inviteCodes,
|
|
9
|
-
}); }).inviteCodes;
|
|
10
|
-
var _b = useLazyQuery(schema.GetMyInviteCodesDocument, {
|
|
11
|
-
context: {
|
|
12
|
-
uri: hosts.identityHost,
|
|
13
|
-
},
|
|
14
|
-
fetchPolicy: 'no-cache',
|
|
15
|
-
onCompleted: function (_a) {
|
|
16
|
-
var getMyInviteCodes = _a.getMyInviteCodes;
|
|
17
|
-
setMyInviteCodes(getMyInviteCodes);
|
|
18
|
-
// console.log('getMyInviteCodes', getMyInviteCodes);
|
|
19
|
-
},
|
|
20
|
-
onError: function () {
|
|
21
|
-
setMyInviteCodes(null);
|
|
22
|
-
},
|
|
23
|
-
}), getMyInviteCodes = _b[0], _c = _b[1], error = _c.error, loading = _c.loading;
|
|
24
|
-
function loadMyInviteCodes() {
|
|
25
|
-
if (!(inviteCodes === null || inviteCodes === void 0 ? void 0 : inviteCodes.length)) {
|
|
26
|
-
getMyInviteCodes();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
myInviteCodes: myInviteCodes || inviteCodes,
|
|
31
|
-
loadMyInviteCodes: loadMyInviteCodes,
|
|
32
|
-
loadingMyInviteCodes: loading,
|
|
33
|
-
errorMyInviteCodes: error,
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export { useGetMyInviteCodes };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const useDeleteUserpic: () => {
|
|
2
|
-
deleteUserpic: (options?: import("@apollo/client").MutationFunctionOptions<any, import("@apollo/client").OperationVariables, {
|
|
3
|
-
uri: string;
|
|
4
|
-
}, import("@apollo/client").ApolloCache<any>>) => Promise<import("@apollo/client").FetchResult<any>>;
|
|
5
|
-
};
|
|
6
|
-
export default useDeleteUserpic;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import { gql, useMutation } from '@apollo/client';
|
|
6
|
-
import { hosts, mediasSchema as schema } from '@ludo.ninja/api';
|
|
7
|
-
var DELETE_USERPIC_MUTATION = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation DeleteUserpic {\n deleteUserpic\n }\n"], ["\n mutation DeleteUserpic {\n deleteUserpic\n }\n"])));
|
|
8
|
-
var useDeleteUserpic = function () {
|
|
9
|
-
var deleteUserpic = useMutation(DELETE_USERPIC_MUTATION, {
|
|
10
|
-
context: {
|
|
11
|
-
uri: hosts.mediasHost,
|
|
12
|
-
},
|
|
13
|
-
refetchQueries: [schema.FetchUserpicDocument],
|
|
14
|
-
// onError: (err) => console.log(err),
|
|
15
|
-
})[0];
|
|
16
|
-
return { deleteUserpic: deleteUserpic };
|
|
17
|
-
};
|
|
18
|
-
export default useDeleteUserpic;
|
|
19
|
-
var templateObject_1;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
-
function step(op) {
|
|
19
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
21
|
-
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;
|
|
22
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
-
switch (op[0]) {
|
|
24
|
-
case 0: case 1: t = op; break;
|
|
25
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
-
default:
|
|
29
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
-
if (t[2]) _.ops.pop();
|
|
34
|
-
_.trys.pop(); continue;
|
|
35
|
-
}
|
|
36
|
-
op = body.call(thisArg, _);
|
|
37
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
import { gql, useMutation } from '@apollo/client';
|
|
42
|
-
import { hosts, mediasSchema as schema } from '@ludo.ninja/api';
|
|
43
|
-
var UPLOAD_USERPIC_MUTATION = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation UploadUserpic($file: Upload!) {\n uploadUserpic(file: $file)\n }\n"], ["\n mutation UploadUserpic($file: Upload!) {\n uploadUserpic(file: $file)\n }\n"])));
|
|
44
|
-
var useUploadUserpic = function () {
|
|
45
|
-
var mutate = useMutation(UPLOAD_USERPIC_MUTATION, {
|
|
46
|
-
context: {
|
|
47
|
-
uri: hosts.mediasHost,
|
|
48
|
-
},
|
|
49
|
-
refetchQueries: [schema.FetchUserpicDocument],
|
|
50
|
-
// onError: (err) => {
|
|
51
|
-
// throw new Error(err as string)
|
|
52
|
-
// },
|
|
53
|
-
})[0];
|
|
54
|
-
return { uploadUserpic: uploadUserpic };
|
|
55
|
-
function uploadUserpic(file) {
|
|
56
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
return __generator(this, function (_a) {
|
|
58
|
-
switch (_a.label) {
|
|
59
|
-
case 0: return [4 /*yield*/, mutate({
|
|
60
|
-
variables: { file: file },
|
|
61
|
-
})];
|
|
62
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
export default useUploadUserpic;
|
|
69
|
-
var templateObject_1;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { hosts, mediasSchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
import { getMediaENVDomain } from '@/utils/env';
|
|
4
|
-
var useFetchUserpic = function () {
|
|
5
|
-
var _a = useState(null), userPic = _a[0], setUserPic = _a[1];
|
|
6
|
-
var _b = schema.useFetchUserpicLazyQuery({
|
|
7
|
-
context: {
|
|
8
|
-
uri: hosts.mediasHost,
|
|
9
|
-
},
|
|
10
|
-
onCompleted: function (_a) {
|
|
11
|
-
var fetchUserpic = _a.fetchUserpic;
|
|
12
|
-
if (fetchUserpic) {
|
|
13
|
-
setUserPic("".concat(getMediaENVDomain(), "/userpics/").concat(fetchUserpic));
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
setUserPic(null);
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
onError: function () {
|
|
20
|
-
setUserPic(null);
|
|
21
|
-
},
|
|
22
|
-
}), fetchUserpic = _b[0], _c = _b[1], data = _c.data, error = _c.error, loading = _c.loading, refetch = _c.refetch;
|
|
23
|
-
function load(userId) {
|
|
24
|
-
fetchUserpic({
|
|
25
|
-
variables: { userId: userId },
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
data: data,
|
|
30
|
-
loading: loading,
|
|
31
|
-
error: error,
|
|
32
|
-
refetch: refetch,
|
|
33
|
-
load: load,
|
|
34
|
-
userPic: userPic,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export default useFetchUserpic;
|
|
@@ -1,71 +0,0 @@
|
|
|
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;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "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 { hosts, opportunitiesSchema } from '@ludo.ninja/api';
|
|
38
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
39
|
-
import { useUiStore } from '@/store/ui';
|
|
40
|
-
export var useDislikeOpportunity = function () {
|
|
41
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
42
|
-
var mutate = opportunitiesSchema.useDislikeOpportunityMutation({
|
|
43
|
-
context: {
|
|
44
|
-
uri: hosts.opportunitiesHost,
|
|
45
|
-
},
|
|
46
|
-
// onCompleted: () => {
|
|
47
|
-
// },
|
|
48
|
-
onError: function (err) {
|
|
49
|
-
openAlert({
|
|
50
|
-
type: alertVariants.error,
|
|
51
|
-
caption: err.message,
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
})[0];
|
|
55
|
-
function dislikeOpportunityAction(_a) {
|
|
56
|
-
var opportunityId = _a.opportunityId;
|
|
57
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
-
return __generator(this, function (_b) {
|
|
59
|
-
switch (_b.label) {
|
|
60
|
-
case 0: return [4 /*yield*/, mutate({
|
|
61
|
-
variables: { opportunityId: opportunityId },
|
|
62
|
-
})];
|
|
63
|
-
case 1:
|
|
64
|
-
_b.sent();
|
|
65
|
-
return [2 /*return*/];
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return { dislikeOpportunityAction: dislikeOpportunityAction };
|
|
71
|
-
};
|