Skip to content

Commit

Permalink
feat: adapt to changes in rmnd_headless_news
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdmlln committed Feb 6, 2024
1 parent f3d7e7c commit f5417a6
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 30 deletions.
3 changes: 1 addition & 2 deletions src/runtime/models/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ export interface Category {
uid?: number
pid?: number
title: string
link: string
description: string
slug: string
active: boolean
seo?: {
title: string
description: string
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/models/content/categoryMenu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Category, Settings } from '..'
import type { ListCategory, Settings } from '..'
import { T3Model } from '#imports'

export interface CategoryMenu extends T3Model.Typo3.Content.Data.Header {
Expand All @@ -8,7 +8,7 @@ export interface CategoryMenu extends T3Model.Typo3.Content.Data.Header {
link: string
active: boolean
}
list: Category[]
list: ListCategory[]
}
settings: Settings
}
Expand Down
6 changes: 3 additions & 3 deletions src/runtime/models/content/newsDetail.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { DetailElement, Settings } from '..'
import type { DetailNews, Settings } from '..'
import { T3Model } from '#imports'

export interface NewsDetail extends T3Model.Typo3.Content.Data.Header {
data: {
contentElements: []
news: DetailElement
contentElements: T3Model.Typo3.Content.Element[]
news: DetailNews
settings: Settings
}
}
4 changes: 2 additions & 2 deletions src/runtime/models/content/newsList.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ListElement, Settings } from '..'
import type { ListNews, Settings } from '..'
import { T3Model } from '#imports'

export interface NewsList extends T3Model.Typo3.Content.Data.Header {
data: {
pagination: T3Model.Typo3.Extbase.Pagination
news: ListElement[]
news: ListNews[]
settings: Settings
}
}
5 changes: 0 additions & 5 deletions src/runtime/models/detailElement.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/runtime/models/detailNews.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { News } from '.'

export interface DetailNews extends News {
bodytext: string
}
8 changes: 5 additions & 3 deletions src/runtime/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export * as Content from './content'
export type { BaseElement } from './baseElement'
export type { Category } from './category'
export type { DetailElement } from './detailElement'
export type { ListElement } from './listElement'
export type { DetailNews } from './detailNews'
export type { ListNews } from './listNews'
export type { ListCategory } from './listCategory'
export type { ListTag } from './listTag'
export type { News } from './news'
export type { Settings } from './settings'
export type { Tag } from './tag'
export type { Year } from './year'
6 changes: 6 additions & 0 deletions src/runtime/models/listCategory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { Category } from '.'

export interface ListCategory extends Category {
link: string
active: boolean
}
5 changes: 0 additions & 5 deletions src/runtime/models/listElement.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/runtime/models/listNews.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { News } from '.'

export interface ListNews extends News {
link: string
}
6 changes: 6 additions & 0 deletions src/runtime/models/listTag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { Tag } from '.'

export interface ListTag extends Tag {
link: string
active: boolean
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Category, Tag } from '.'
import { T3Model } from '#imports'

export interface BaseElement {
export interface News {
uid: number
title: string
teaser: string
Expand All @@ -14,9 +15,8 @@ export interface BaseElement {
email: string
}
relatedFiles: T3Model.Typo3.Asset[]
// TODO specify types
categories: []
tags: []
categories: Category[]
tags: Tag[]
metaData: {
keywords: string
description: string
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/models/settings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export interface Settings {
orderBy?: string
orderDirection?: 'asc' | 'desc'
templateLayout: string
}
2 changes: 0 additions & 2 deletions src/runtime/models/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ export interface Tag {
uid?: number
pid?: number
title: string
link: string
slug: string
active: boolean
seo?: {
title: string
description: string
Expand Down

0 comments on commit f5417a6

Please sign in to comment.