@ludo.ninja/components 1.5.9 → 1.6.1
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,70 +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, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
39
|
-
var useCreateGalleryV2 = function () {
|
|
40
|
-
var _a = useMutation(schema.CreateGalleryV2Document, {
|
|
41
|
-
context: {
|
|
42
|
-
uri: hosts.galleriesHost,
|
|
43
|
-
},
|
|
44
|
-
fetchPolicy: 'no-cache',
|
|
45
|
-
}), mutate = _a[0], error = _a[1].error;
|
|
46
|
-
return { createGallery: createGallery, errorCreateGallery: error };
|
|
47
|
-
function createGallery(_a) {
|
|
48
|
-
var name = _a.name, description = _a.description, publicAccessible = _a.publicAccessible, creationIds = _a.creationIds;
|
|
49
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
-
var err_1;
|
|
51
|
-
return __generator(this, function (_b) {
|
|
52
|
-
switch (_b.label) {
|
|
53
|
-
case 0:
|
|
54
|
-
_b.trys.push([0, 2, , 3]);
|
|
55
|
-
return [4 /*yield*/, mutate({
|
|
56
|
-
variables: { name: name, description: description, publicAccessible: publicAccessible, creationIds: creationIds },
|
|
57
|
-
})];
|
|
58
|
-
case 1:
|
|
59
|
-
_b.sent();
|
|
60
|
-
return [3 /*break*/, 3];
|
|
61
|
-
case 2:
|
|
62
|
-
err_1 = _b.sent();
|
|
63
|
-
throw new Error(err_1);
|
|
64
|
-
case 3: return [2 /*return*/];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
export { useCreateGalleryV2 };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { galleriesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useDeleteGallery: () => {
|
|
3
|
-
deleteGallery: ({ galleryId, }: schema.IDeleteGalleryMutationVariables) => Promise<{
|
|
4
|
-
isSuccess: boolean;
|
|
5
|
-
}>;
|
|
6
|
-
errorDelete: import("@apollo/client").ApolloError;
|
|
7
|
-
};
|
|
8
|
-
export default useDeleteGallery;
|
|
@@ -1,87 +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, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
39
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
40
|
-
import { useUiStore } from '@/store/ui';
|
|
41
|
-
var useDeleteGallery = function () {
|
|
42
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
43
|
-
var _a = useMutation(schema.DeleteGalleryDocument, {
|
|
44
|
-
context: {
|
|
45
|
-
uri: hosts.galleriesHost,
|
|
46
|
-
},
|
|
47
|
-
fetchPolicy: 'no-cache',
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
-
onCompleted: function (res) {
|
|
50
|
-
openAlert({
|
|
51
|
-
type: alertVariants.success,
|
|
52
|
-
caption: 'Gallery successfully deleted!',
|
|
53
|
-
text: '',
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
onError: function () {
|
|
57
|
-
openAlert({
|
|
58
|
-
type: alertVariants.error,
|
|
59
|
-
caption: 'Oops, gallery deletion failed.',
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
}), mutate = _a[0], error = _a[1].error;
|
|
63
|
-
return { deleteGallery: deleteGallery, errorDelete: error };
|
|
64
|
-
function deleteGallery(_a) {
|
|
65
|
-
var galleryId = _a.galleryId;
|
|
66
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
-
var data, err_1;
|
|
68
|
-
return __generator(this, function (_b) {
|
|
69
|
-
switch (_b.label) {
|
|
70
|
-
case 0:
|
|
71
|
-
_b.trys.push([0, 2, , 3]);
|
|
72
|
-
return [4 /*yield*/, mutate({
|
|
73
|
-
variables: { galleryId: galleryId },
|
|
74
|
-
})];
|
|
75
|
-
case 1:
|
|
76
|
-
data = (_b.sent()).data;
|
|
77
|
-
return [2 /*return*/, { isSuccess: data.deleteGallery }];
|
|
78
|
-
case 2:
|
|
79
|
-
err_1 = _b.sent();
|
|
80
|
-
throw new Error(err_1);
|
|
81
|
-
case 3: return [2 /*return*/];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
export default useDeleteGallery;
|
|
@@ -1,83 +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, mediasSchema as schema } from '@ludo.ninja/api';
|
|
39
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
40
|
-
import { useUiStore } from '@/store/ui';
|
|
41
|
-
export var useDeleteGalleryBanner = function () {
|
|
42
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
43
|
-
var _a = useMutation(schema.DeleteGalleryBannerDocument, {
|
|
44
|
-
context: {
|
|
45
|
-
uri: hosts.mediasHost,
|
|
46
|
-
},
|
|
47
|
-
fetchPolicy: 'no-cache',
|
|
48
|
-
onCompleted: function () {
|
|
49
|
-
openAlert({
|
|
50
|
-
type: alertVariants.success,
|
|
51
|
-
caption: 'Banner successfully removed!',
|
|
52
|
-
text: '',
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
// onCompleted: (res) => {
|
|
56
|
-
// console.log(res);
|
|
57
|
-
// },
|
|
58
|
-
// onError: (err) => console.log(err),
|
|
59
|
-
}), mutate = _a[0], error = _a[1].error;
|
|
60
|
-
return { deleteBanner: deleteBanner, error: error };
|
|
61
|
-
function deleteBanner(_a) {
|
|
62
|
-
var galleryId = _a.galleryId;
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
var err_1;
|
|
65
|
-
return __generator(this, function (_b) {
|
|
66
|
-
switch (_b.label) {
|
|
67
|
-
case 0:
|
|
68
|
-
_b.trys.push([0, 2, , 3]);
|
|
69
|
-
return [4 /*yield*/, mutate({
|
|
70
|
-
variables: { galleryId: galleryId },
|
|
71
|
-
})];
|
|
72
|
-
case 1:
|
|
73
|
-
_b.sent();
|
|
74
|
-
return [3 /*break*/, 3];
|
|
75
|
-
case 2:
|
|
76
|
-
err_1 = _b.sent();
|
|
77
|
-
throw new Error(err_1);
|
|
78
|
-
case 3: return [2 /*return*/];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { galleriesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useEditGallery: () => {
|
|
3
|
-
editGallery: ({ galleryId, name, description, }: schema.IEditGalleryMutationVariables) => Promise<import("@apollo/client").FetchResult<any>>;
|
|
4
|
-
};
|
|
5
|
-
export default useEditGallery;
|
|
@@ -1,62 +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, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
39
|
-
var useEditGallery = function () {
|
|
40
|
-
var mutate = useMutation(schema.EditGalleryDocument, {
|
|
41
|
-
context: {
|
|
42
|
-
uri: hosts.galleriesHost,
|
|
43
|
-
},
|
|
44
|
-
fetchPolicy: 'no-cache',
|
|
45
|
-
// refetchQueries: [
|
|
46
|
-
// schema.FetchUserFavoritesDocument,
|
|
47
|
-
// schema.FetchUserGalleriesDocument,
|
|
48
|
-
// ],
|
|
49
|
-
})[0];
|
|
50
|
-
function editGallery(_a) {
|
|
51
|
-
var galleryId = _a.galleryId, name = _a.name, description = _a.description;
|
|
52
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
53
|
-
return __generator(this, function (_b) {
|
|
54
|
-
return [2 /*return*/, mutate({
|
|
55
|
-
variables: { name: name, description: description, galleryId: galleryId },
|
|
56
|
-
})];
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return { editGallery: editGallery };
|
|
61
|
-
};
|
|
62
|
-
export default useEditGallery;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { galleriesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useRemoveAssetFromGalleryV2: () => {
|
|
3
|
-
removeAssetFromGallery: ({ galleryId, assetId, }: schema.IMutationRemoveAssetFromGalleryV2Args) => Promise<void>;
|
|
4
|
-
errorRemoveAsset: import("@apollo/client").ApolloError;
|
|
5
|
-
isAssetRemoved: boolean;
|
|
6
|
-
};
|
|
7
|
-
export { useRemoveAssetFromGalleryV2 };
|
|
@@ -1,95 +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 { useState } from 'react';
|
|
38
|
-
import { useMutation } from '@apollo/client';
|
|
39
|
-
import { hosts, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
40
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
41
|
-
import { useUiStore } from '@/store/ui';
|
|
42
|
-
var useRemoveAssetFromGalleryV2 = function () {
|
|
43
|
-
var _a = useState(false), isRemoved = _a[0], setRemove = _a[1];
|
|
44
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
45
|
-
var _b = useMutation(schema.RemoveAssetFromGalleryV2Document, {
|
|
46
|
-
context: {
|
|
47
|
-
uri: hosts.galleriesHost,
|
|
48
|
-
},
|
|
49
|
-
fetchPolicy: 'no-cache',
|
|
50
|
-
onCompleted: function (_a) {
|
|
51
|
-
var removeAssetFromGalleryV2 = _a.removeAssetFromGalleryV2;
|
|
52
|
-
setRemove(removeAssetFromGalleryV2);
|
|
53
|
-
openAlert({
|
|
54
|
-
type: alertVariants.success,
|
|
55
|
-
caption: 'NFT successfully removed!',
|
|
56
|
-
text: '',
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
refetchQueries: [schema.FetchUserGalleriesV2Document],
|
|
60
|
-
onError: function () {
|
|
61
|
-
openAlert({
|
|
62
|
-
type: alertVariants.error,
|
|
63
|
-
caption: 'Oops, something went wrong.',
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
}), mutate = _b[0], error = _b[1].error;
|
|
67
|
-
return {
|
|
68
|
-
removeAssetFromGallery: removeAssetFromGallery,
|
|
69
|
-
errorRemoveAsset: error,
|
|
70
|
-
isAssetRemoved: isRemoved,
|
|
71
|
-
};
|
|
72
|
-
function removeAssetFromGallery(_a) {
|
|
73
|
-
var galleryId = _a.galleryId, assetId = _a.assetId;
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
var err_1;
|
|
76
|
-
return __generator(this, function (_b) {
|
|
77
|
-
switch (_b.label) {
|
|
78
|
-
case 0:
|
|
79
|
-
_b.trys.push([0, 2, , 3]);
|
|
80
|
-
return [4 /*yield*/, mutate({
|
|
81
|
-
variables: { galleryId: galleryId, assetId: assetId },
|
|
82
|
-
})];
|
|
83
|
-
case 1:
|
|
84
|
-
_b.sent();
|
|
85
|
-
return [3 /*break*/, 3];
|
|
86
|
-
case 2:
|
|
87
|
-
err_1 = _b.sent();
|
|
88
|
-
throw new Error(err_1);
|
|
89
|
-
case 3: return [2 /*return*/];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
export { useRemoveAssetFromGalleryV2 };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { galleriesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
-
declare const useRemoveCollectionFromGalleryV2: () => {
|
|
3
|
-
removeCollectionFromGallery: ({ galleryId, collectionId, }: schema.IMutationRemoveCollectionFromGalleryV2Args) => Promise<void>;
|
|
4
|
-
errorRemoveCollection: import("@apollo/client").ApolloError;
|
|
5
|
-
isCollectionRemoved: boolean;
|
|
6
|
-
};
|
|
7
|
-
export { useRemoveCollectionFromGalleryV2 };
|
|
@@ -1,90 +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 { useState } from 'react';
|
|
38
|
-
import { useMutation } from '@apollo/client';
|
|
39
|
-
import { hosts, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
40
|
-
import { alertVariants } from '@ludo.ninja/ui/build/system/Alert/type';
|
|
41
|
-
import { useUiStore } from '@/store/ui';
|
|
42
|
-
var useRemoveCollectionFromGalleryV2 = function () {
|
|
43
|
-
var _a = useState(false), isRemoved = _a[0], setRemove = _a[1];
|
|
44
|
-
var openAlert = useUiStore(function (state) { return state.openAlert; });
|
|
45
|
-
var _b = useMutation(schema.RemoveCollectionFromGalleryV2Document, {
|
|
46
|
-
context: {
|
|
47
|
-
uri: hosts.galleriesHost,
|
|
48
|
-
},
|
|
49
|
-
fetchPolicy: 'no-cache',
|
|
50
|
-
onCompleted: function (_a) {
|
|
51
|
-
var removeCollectionFromGallery = _a.removeCollectionFromGallery;
|
|
52
|
-
setRemove(removeCollectionFromGallery);
|
|
53
|
-
openAlert({
|
|
54
|
-
type: alertVariants.success,
|
|
55
|
-
caption: 'Collection successfully removed!',
|
|
56
|
-
text: '',
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
refetchQueries: [schema.FetchUserGalleriesV2Document],
|
|
60
|
-
// onError: (err) => console.log(err),
|
|
61
|
-
}), mutate = _b[0], error = _b[1].error;
|
|
62
|
-
return {
|
|
63
|
-
removeCollectionFromGallery: removeCollectionFromGallery,
|
|
64
|
-
errorRemoveCollection: error,
|
|
65
|
-
isCollectionRemoved: isRemoved,
|
|
66
|
-
};
|
|
67
|
-
function removeCollectionFromGallery(_a) {
|
|
68
|
-
var galleryId = _a.galleryId, collectionId = _a.collectionId;
|
|
69
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
var err_1;
|
|
71
|
-
return __generator(this, function (_b) {
|
|
72
|
-
switch (_b.label) {
|
|
73
|
-
case 0:
|
|
74
|
-
_b.trys.push([0, 2, , 3]);
|
|
75
|
-
return [4 /*yield*/, mutate({
|
|
76
|
-
variables: { galleryId: galleryId, collectionId: collectionId },
|
|
77
|
-
})];
|
|
78
|
-
case 1:
|
|
79
|
-
_b.sent();
|
|
80
|
-
return [3 /*break*/, 3];
|
|
81
|
-
case 2:
|
|
82
|
-
err_1 = _b.sent();
|
|
83
|
-
throw new Error(err_1);
|
|
84
|
-
case 3: return [2 /*return*/];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
export { useRemoveCollectionFromGalleryV2 };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { galleriesSchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
import GalleryEntityV2 from '@/dto/GalleryEntityV2';
|
|
4
|
-
declare const prefetchGalleryV2: ({ galleryId }: schema.IQueryFetchGalleryV2Args, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
5
|
-
data: {
|
|
6
|
-
fetchGalleryV2: any;
|
|
7
|
-
};
|
|
8
|
-
}>;
|
|
9
|
-
declare const useFetchGalleryV2: ({ galleryId, }: {
|
|
10
|
-
galleryId: schema.IQueryFetchGalleryV2Args;
|
|
11
|
-
}) => {
|
|
12
|
-
clientDataLoading: boolean;
|
|
13
|
-
clientDataError: import("@apollo/client").ApolloError;
|
|
14
|
-
clientData: GalleryEntityV2;
|
|
15
|
-
};
|
|
16
|
-
export { prefetchGalleryV2, useFetchGalleryV2 };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { useQuery } from '@apollo/client';
|
|
3
|
-
import { hosts, galleriesSchema as schema } from '@ludo.ninja/api';
|
|
4
|
-
import GalleryEntityV2 from '@/dto/GalleryEntityV2';
|
|
5
|
-
var prefetchGalleryV2 = function (_a, apolloClient) {
|
|
6
|
-
var galleryId = _a.galleryId;
|
|
7
|
-
return apolloClient
|
|
8
|
-
.query({
|
|
9
|
-
query: schema.FetchGalleryV2Document,
|
|
10
|
-
variables: { galleryId: galleryId },
|
|
11
|
-
context: { uri: hosts.serverGalleriesHost },
|
|
12
|
-
fetchPolicy: 'network-only',
|
|
13
|
-
})
|
|
14
|
-
.catch(function () {
|
|
15
|
-
return {
|
|
16
|
-
data: { fetchGalleryV2: null },
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
var useFetchGalleryV2 = function (_a) {
|
|
21
|
-
var galleryId = _a.galleryId;
|
|
22
|
-
var _b = useState(null), gallery = _b[0], setGallery = _b[1];
|
|
23
|
-
var _c = useQuery(schema.FetchGalleryV2Document, {
|
|
24
|
-
variables: { galleryId: galleryId },
|
|
25
|
-
context: {
|
|
26
|
-
uri: hosts.galleriesHost,
|
|
27
|
-
},
|
|
28
|
-
onCompleted: function (_a) {
|
|
29
|
-
var fetchGalleryV2 = _a.fetchGalleryV2;
|
|
30
|
-
setGallery(new GalleryEntityV2(fetchGalleryV2));
|
|
31
|
-
},
|
|
32
|
-
onError: function () {
|
|
33
|
-
setGallery(null);
|
|
34
|
-
},
|
|
35
|
-
}), error = _c.error, loading = _c.loading;
|
|
36
|
-
return {
|
|
37
|
-
clientDataLoading: loading,
|
|
38
|
-
clientDataError: error,
|
|
39
|
-
clientData: gallery,
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export { prefetchGalleryV2, useFetchGalleryV2 };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const FETCH_GALLERY_ASSETS_QUERY: import("@apollo/client").DocumentNode;
|
|
2
|
-
declare const useFetchGalleryAssets: (galleryId: string, pageSize: number) => {
|
|
3
|
-
loadMore: (pageToken: string) => Promise<void>;
|
|
4
|
-
refetchGalleryAssetsQuery: {
|
|
5
|
-
query: import("@apollo/client").DocumentNode;
|
|
6
|
-
variables: {
|
|
7
|
-
galleryId: string;
|
|
8
|
-
pageSize: number;
|
|
9
|
-
};
|
|
10
|
-
context: {
|
|
11
|
-
uri: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
loading: boolean;
|
|
15
|
-
error: import("@apollo/client").ApolloError;
|
|
16
|
-
data: any;
|
|
17
|
-
};
|
|
18
|
-
export default useFetchGalleryAssets;
|