get all urls strapi integration

This commit is contained in:
tmshv committed 2021-02-16 20:07:31 +03:00
1 parent 87f4f6a1b8
commit 5ccec9e2ba
2 files changed
+11 -4

No files matched your search

+6
View File
@@ -3,6 +3,12 @@ import { IPage, PageCardDto, Token } from "@/types";
import { asItem } from "./lib";
import { StrapiComponent, StrapiHome, StrapiPage, StrapiPageCard } from "./types";
export function createPageUrls(pages: StrapiPage[]) {
return {
items: pages.map(page => page.slug),
}
}
export function createPageTokens(components: StrapiComponent[]): Token[] {
return components.map(component => {
switch (component.__component) {