itube-specs 0.0.795 → 0.0.797
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/components/ui/input.vue +2 -0
- package/composables/fetch/use-fetch-categories-by-letter.ts +15 -15
- package/composables/fetch/use-fetch-categories-by-phrase.ts +18 -18
- package/composables/fetch/use-fetch-categories-group-by-letter.ts +13 -13
- package/composables/fetch/use-fetch-channels-by-model.ts +18 -18
- package/composables/fetch/use-fetch-channels-by-name.ts +15 -15
- package/composables/fetch/use-fetch-channels-by-network-name.ts +30 -30
- package/composables/fetch/use-fetch-channels.ts +31 -31
- package/composables/fetch/use-fetch-dictionaries-countries.ts +13 -13
- package/composables/fetch/use-fetch-dictionaries-genders.ts +13 -13
- package/composables/fetch/use-fetch-groups-categories-lazy.ts +15 -15
- package/composables/fetch/use-fetch-groups-categories.ts +13 -13
- package/composables/fetch/use-fetch-model-by-name.ts +15 -15
- package/composables/fetch/use-fetch-models-by-category.ts +17 -17
- package/composables/fetch/use-fetch-models-by-channel.ts +17 -17
- package/composables/fetch/use-fetch-models-by-letter.ts +40 -40
- package/composables/fetch/use-fetch-models-by-phrases.ts +32 -32
- package/composables/fetch/use-fetch-models-by-tag.ts +1 -1
- package/composables/fetch/use-fetch-models-related.ts +24 -24
- package/composables/fetch/use-fetch-models.ts +38 -38
- package/composables/fetch/use-fetch-multi-suggest.ts +27 -27
- package/composables/fetch/use-fetch-playlists-by-id.ts +15 -15
- package/composables/fetch/use-fetch-playlists-by-niche.ts +30 -30
- package/composables/fetch/use-fetch-playlists-get-videos-by-id.ts +29 -29
- package/composables/fetch/use-fetch-related-searches.ts +11 -11
- package/composables/fetch/use-fetch-related-videos.ts +27 -27
- package/composables/fetch/use-fetch-top-chips-models.ts +15 -15
- package/composables/fetch/use-fetch-top-models.ts +19 -19
- package/composables/fetch/use-fetch-top-random-categories.ts +13 -13
- package/composables/fetch/use-fetch-top-random-full.ts +17 -17
- package/composables/fetch/use-fetch-video-referer-phrases.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-categories.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-channel.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-model-and-channel.ts +40 -40
- package/composables/fetch/use-fetch-videos-by-model-and-tag.ts +40 -40
- package/composables/fetch/use-fetch-videos-by-model.ts +34 -34
- package/composables/fetch/use-fetch-videos-by-tag.ts +34 -34
- package/composables/fetch/use-fetch-videos-search-by-niche.ts +32 -32
- package/composables/use-api-fetcher-no-cache.ts +24 -24
- package/composables/use-api-fetcher.ts +19 -19
- package/composables/use-get-videos-filter-request.ts +28 -28
- package/composables/use-lang.ts +8 -8
- package/composables/use-meta.ts +54 -54
- package/composables/use-noindex.ts +8 -8
- package/composables/use-report-popup.ts +19 -19
- package/lib/contact-forms-scheme.ts +92 -92
- package/lib/contacts/report-issue-items.ts +3 -3
- package/lib/contacts/report-malware-items.ts +4 -4
- package/lib/contacts/report-reasons-items.ts +10 -10
- package/lib/contacts/report-wrong-items.ts +4 -4
- package/lib/report-forms-scheme.ts +259 -259
- package/lib/scheme/categories-navigation.ts +8 -8
- package/lib/scheme/select-added-items.ts +41 -41
- package/lib/scheme/select-duration-items.ts +35 -35
- package/nuxt.config.ts +18 -18
- package/package.json +1 -1
- package/runtime/constants/adverts.ts +5 -5
- package/runtime/constants/async-data.ts +57 -57
- package/runtime/constants/languages.ts +12 -12
- package/runtime/constants/niche.ts +3 -3
- package/runtime/constants/playlist-type.ts +2 -2
- package/runtime/utils/check-device-width.ts +18 -18
- package/runtime/utils/cleaners/clean-mini-category-card.ts +5 -5
- package/runtime/utils/cleaners/clean-model-card.ts +20 -20
- package/runtime/utils/cleaners/clean-video-data.ts +50 -50
- package/runtime/utils/converters/convert-date-to-timestamp.ts +22 -22
- package/runtime/utils/converters/convert-query-categories.ts +2 -2
- package/runtime/utils/converters/convert-string-array-to-chips.ts +6 -6
- package/runtime/utils/converters/convert-string.ts +0 -0
- package/runtime/utils/server/age.ts +55 -55
- package/runtime/utils/server/api-helper.ts +26 -26
- package/runtime/utils/server/get-url-with-proxied-params.ts +3 -3
- package/runtime/utils/server/server-api-helper.ts +15 -15
- package/runtime/utils/validate-email.ts +2 -2
- package/services/api/categories.service.ts +222 -222
- package/services/api/dictionaries.service.ts +28 -28
- package/services/api/models.service.ts +297 -297
- package/types/authorization-forms.d.ts +8 -8
- package/types/burger-menu-item.d.ts +5 -5
- package/types/change-email-form.d.ts +1 -1
- package/types/change-password-form.d.ts +2 -2
- package/types/chips-item.d.ts +8 -8
- package/types/contacts-scheme.d.ts +9 -9
- package/types/country.d.ts +5 -5
- package/types/fluid-player.d.ts +176 -176
- package/types/gender.d.ts +4 -4
- package/types/group-categories.d.ts +10 -10
- package/types/info-chips.d.ts +2 -2
- package/types/model-card.d.ts +15 -15
- package/types/model-filter-payload.d.ts +2 -2
- package/types/model-filter.d.ts +10 -10
- package/types/model-group.d.ts +4 -4
- package/types/model-tag.d.ts +3 -3
- package/types/playlist-short.d.ts +2 -2
- package/types/playlist-video-form.d.ts +7 -7
- package/types/popular-tags.d.ts +2 -2
- package/types/raw/raw-playlist-user.d.ts +20 -20
- package/types/raw/raw-thumbs-urls.d.ts +2 -2
- package/types/raw/raw-video-card.d.ts +70 -70
- package/types/raw/raw-video-data.d.ts +50 -50
- package/types/recovery-password-form.d.ts +2 -2
- package/types/report-request.d.ts +2 -2
- package/types/report-scheme.d.ts +18 -18
- package/types/request-filters.d.ts +10 -10
- package/types/request-pagination.d.ts +2 -2
- package/types/search-top-models.d.ts +4 -4
- package/types/site.d.ts +15 -15
- package/types/thumbs-urls.d.ts +1 -1
package/components/ui/input.vue
CHANGED
|
@@ -236,6 +236,7 @@ const normalizedValue = computed(() => {
|
|
|
236
236
|
transition: var(--transition) transform;
|
|
237
237
|
resize: none;
|
|
238
238
|
font: inherit;
|
|
239
|
+
font-size: 16px;
|
|
239
240
|
border: 1px solid transparent;
|
|
240
241
|
|
|
241
242
|
&:focus {
|
|
@@ -245,6 +246,7 @@ const normalizedValue = computed(() => {
|
|
|
245
246
|
@include from-br(sm) {
|
|
246
247
|
padding-block: 8px;
|
|
247
248
|
padding-inline: 16px;
|
|
249
|
+
font-size: 14px;
|
|
248
250
|
}
|
|
249
251
|
}
|
|
250
252
|
|
|
@@ -3,22 +3,22 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { ICategoryCard } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesByLetter = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<Array<ICategoryCard>>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const key = AsyncData.CategoriesByLetter;
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const slug = useSlug();
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const { data, status, error } = await useAsyncData<Array<ICategoryCard>>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
() => useApiFetcher<Array<ICategoryCard>>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
apiMethod,
|
|
18
|
+
lang,
|
|
19
|
+
slug.value,
|
|
20
|
+
)()
|
|
21
|
+
);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
return { data, status, error };
|
|
24
24
|
};
|
|
@@ -3,25 +3,25 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IChipsItem } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchCategoriesByPhrase = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<Array<IChipsItem>>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const key = AsyncData.CategoriesByPhrase;
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const slug = useSlug();
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
const { data, status, error } = await useAsyncData<Array<IChipsItem>>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
() => useApiFetcher<Array<IChipsItem>>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
apiMethod,
|
|
18
|
+
lang,
|
|
19
|
+
slug.value,
|
|
20
|
+
1,
|
|
21
|
+
1,
|
|
22
|
+
100
|
|
23
|
+
)()
|
|
24
|
+
);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
return { data, status, error };
|
|
27
27
|
};
|
|
@@ -2,20 +2,20 @@ import type { AsyncData, Language } from '../../runtime';
|
|
|
2
2
|
import type { ICategoryCard, IChipsItem } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const useFetchCategoriesGroupByLetter = async (
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
key: AsyncData,
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<Record<string, Array<ICategoryCard>>> | Promise<IChipsItem[]>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
const { data, error, refresh, status } = await useAsyncData<Record<string, Array<ICategoryCard>> | IChipsItem[]>(
|
|
12
|
+
key,
|
|
13
|
+
() => useApiFetcher<Record<string, Array<ICategoryCard>> | IChipsItem[]>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
apiMethod,
|
|
16
|
+
lang,
|
|
17
|
+
)(),
|
|
18
|
+
);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
return { data, error, refresh, status };
|
|
21
21
|
};
|
|
@@ -3,25 +3,25 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchChannelsByModel = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IChannelCard>>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const slug = useSlug();
|
|
10
|
+
const key = AsyncData.ChannelsByModel;
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
() => useApiFetcher<PaginatedResponse<IChannelCard>>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
apiMethod,
|
|
18
|
+
lang,
|
|
19
|
+
{
|
|
20
|
+
page: 1,
|
|
21
|
+
},
|
|
22
|
+
slug.value,
|
|
23
|
+
)(),
|
|
24
|
+
);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
return { data, status, error };
|
|
27
27
|
};
|
|
@@ -3,22 +3,22 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { ICardInfo } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchChannelsByName = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<ICardInfo>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const slug = useSlug('channel');
|
|
10
|
+
const key = AsyncData.ChannelByName;
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const { data, status, error } = await useAsyncData<ICardInfo>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
() => useApiFetcher<ICardInfo>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
apiMethod,
|
|
18
|
+
lang,
|
|
19
|
+
slug.value,
|
|
20
|
+
)()
|
|
21
|
+
);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
return { data, status, error };
|
|
24
24
|
};
|
|
@@ -4,37 +4,37 @@ import { AsyncData } from '../../runtime';
|
|
|
4
4
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
5
5
|
|
|
6
6
|
export const useFetchChannelsByNetworkName = async (
|
|
7
|
-
|
|
7
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IChannelCard>>
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
|
+
const perPage = mobile ? 12 : 48;
|
|
13
|
+
const slug = useSlug('channel');
|
|
14
|
+
const key = AsyncData.ChannelsByNetworkName;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
18
|
+
stateKey.value,
|
|
19
|
+
() => useApiFetcher<PaginatedResponse<IChannelCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
lang,
|
|
23
|
+
{
|
|
24
|
+
page: Number(route.query['page']) || 1,
|
|
25
|
+
'per-page': perPage,
|
|
26
|
+
},
|
|
27
|
+
slug.value,
|
|
28
|
+
)(),
|
|
29
|
+
{
|
|
30
|
+
watch: [
|
|
31
|
+
() => {
|
|
32
|
+
const currentQuery = route.query;
|
|
33
|
+
return JSON.stringify(currentQuery);
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
return { data, status, error };
|
|
40
40
|
};
|
|
@@ -5,38 +5,38 @@ import { sortChannels } from '../../lib';
|
|
|
5
5
|
import type { IChannelCard, PaginatedResponse } from '../../types';
|
|
6
6
|
|
|
7
7
|
export const useFetchChannels = async (
|
|
8
|
-
|
|
8
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IChannelCard>>
|
|
9
9
|
) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const mobile = !!useState<boolean>('isMobile').value;
|
|
12
|
+
const perPage = mobile ? 12 : 48;
|
|
13
|
+
const lang = useLang() as Language;
|
|
14
|
+
const key = AsyncData.Channels;
|
|
15
|
+
const stateKey = computed(() => `data-${key}-${JSON.stringify(route.query)}-${lang}`);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
const { data, status, error } = await useAsyncData<PaginatedResponse<IChannelCard>>(
|
|
18
|
+
key,
|
|
19
|
+
() => useApiFetcher<PaginatedResponse<IChannelCard>>(
|
|
20
|
+
stateKey.value,
|
|
21
|
+
apiMethod,
|
|
22
|
+
lang,
|
|
23
|
+
{
|
|
24
|
+
page: Number(route.query['page']) || 1,
|
|
25
|
+
'per-page': perPage,
|
|
26
|
+
},
|
|
27
|
+
getSelectedQuery(route, sortChannels) || '-popularity',
|
|
28
|
+
)(),
|
|
29
|
+
{
|
|
30
|
+
watch: [
|
|
31
|
+
() => {
|
|
32
|
+
if (route.query) {
|
|
33
|
+
const currentQuery = route.query;
|
|
34
|
+
return JSON.stringify(currentQuery);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
return { data, status, error };
|
|
42
42
|
};
|
|
@@ -3,20 +3,20 @@ import type { Language } from '../../runtime';
|
|
|
3
3
|
import { AsyncData } from '../../runtime';
|
|
4
4
|
|
|
5
5
|
export const useFetchDictionariesCountries = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<ICountries>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.Countries;
|
|
10
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const { data, status, error } = await useAsyncData<ICountries>(
|
|
13
|
+
key,
|
|
14
|
+
() => useApiFetcher<ICountries>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
apiMethod,
|
|
17
|
+
lang,
|
|
18
|
+
)(),
|
|
19
|
+
);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
return { countriesData: data, status, error };
|
|
22
22
|
};
|
|
@@ -3,20 +3,20 @@ import type { Language } from '../../runtime';
|
|
|
3
3
|
import { AsyncData } from '../../runtime';
|
|
4
4
|
|
|
5
5
|
export const useFetchDictionariesGenders = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<IGenders>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.Genders;
|
|
10
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const { data, status, error } = await useAsyncData<IGenders>(
|
|
13
|
+
key,
|
|
14
|
+
() => useApiFetcher<IGenders>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
apiMethod,
|
|
17
|
+
lang,
|
|
18
|
+
)(),
|
|
19
|
+
);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
return { gendersData: data, status, error };
|
|
22
22
|
};
|
|
@@ -2,23 +2,23 @@ import type { Language } from '../../runtime';
|
|
|
2
2
|
import type { IGroupCategories } from '../../types';
|
|
3
3
|
|
|
4
4
|
export const useFetchGroupsCategoriesLazy = (
|
|
5
|
-
|
|
5
|
+
apiMethod: (...args: any[]) => Promise<IGroupCategories[]>
|
|
6
6
|
) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const data = useState<IGroupCategories[] | null>('lazy-groups-categories', () => null);
|
|
8
|
+
const isLoading = useState<boolean>('lazy-groups-categories-loading', () => false);
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
11
|
+
async function load() {
|
|
12
|
+
if (data.value?.length || isLoading.value) return;
|
|
13
|
+
isLoading.value = true;
|
|
14
|
+
try {
|
|
15
|
+
data.value = await apiMethod(lang);
|
|
16
|
+
} catch (err) {
|
|
17
|
+
console.error('Failed to load groups categories:', err);
|
|
18
|
+
} finally {
|
|
19
|
+
isLoading.value = false;
|
|
21
20
|
}
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
return { data, isLoading, load };
|
|
24
24
|
};
|
|
@@ -3,20 +3,20 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IGroupCategories } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchGroupsCategories = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<IGroupCategories[]>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const key = AsyncData.GroupsCategoriesFilter;
|
|
10
|
+
const stateKey = computed(() => `data-${key}-${lang}`);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const { data, pending: status, error } = await useAsyncData<IGroupCategories[]>(
|
|
13
|
+
key,
|
|
14
|
+
() => useApiFetcher<IGroupCategories[]>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
apiMethod,
|
|
17
|
+
lang,
|
|
18
|
+
)(),
|
|
19
|
+
);
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
return { data, status, error };
|
|
22
22
|
};
|
|
@@ -3,22 +3,22 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { ICardInfo } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelByName = async (
|
|
6
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<ICardInfo>
|
|
7
7
|
) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const lang = useLang() as Language;
|
|
9
|
+
const slug = useSlug();
|
|
10
|
+
const key = AsyncData.ModelsByName;
|
|
11
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
const { data, status, error } = await useAsyncData<ICardInfo>(
|
|
14
|
+
stateKey.value,
|
|
15
|
+
() => useApiFetcher<ICardInfo>(
|
|
16
|
+
stateKey.value,
|
|
17
|
+
apiMethod,
|
|
18
|
+
lang,
|
|
19
|
+
slug.value,
|
|
20
|
+
)()
|
|
21
|
+
);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
return { data, status, error };
|
|
24
24
|
};
|
|
@@ -3,24 +3,24 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelsByCategory = async (
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
|
+
limit: number,
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const slug = useSlug();
|
|
11
|
+
const key = AsyncData.ModelsByCategory;
|
|
12
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const { data, status } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
17
|
+
stateKey.value,
|
|
18
|
+
apiMethod,
|
|
19
|
+
slug.value,
|
|
20
|
+
limit,
|
|
21
|
+
lang,
|
|
22
|
+
)(),
|
|
23
|
+
);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
return { data, status };
|
|
26
26
|
};
|
|
@@ -3,24 +3,24 @@ import { AsyncData } from '../../runtime';
|
|
|
3
3
|
import type { IModelCard, PaginatedResponse } from '../../types';
|
|
4
4
|
|
|
5
5
|
export const useFetchModelsByChannel = async (
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
apiMethod: (...args: any[]) => Promise<PaginatedResponse<IModelCard>>,
|
|
7
|
+
limit: number,
|
|
8
8
|
) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const lang = useLang() as Language;
|
|
10
|
+
const slug = useSlug('channel');
|
|
11
|
+
const key = AsyncData.ModelsByChannel;
|
|
12
|
+
const stateKey = computed(() => `data-${key}-${slug.value}-${lang}`);
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const { data, status } = await useAsyncData<PaginatedResponse<IModelCard>>(
|
|
15
|
+
stateKey.value,
|
|
16
|
+
() => useApiFetcher<PaginatedResponse<IModelCard>>(
|
|
17
|
+
stateKey.value,
|
|
18
|
+
apiMethod,
|
|
19
|
+
slug.value,
|
|
20
|
+
limit,
|
|
21
|
+
lang,
|
|
22
|
+
)(),
|
|
23
|
+
);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
return { data, status };
|
|
26
26
|
};
|