File tree 5 files changed +12
-11
lines changed 5 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 8
8
import type {
9
9
NewsEventsApiNewsEventsListRequest ,
10
10
TestimonialsApi ,
11
+ ChannelsApi ,
11
12
} from "../generated/v0"
12
13
import type {
13
14
LearningResourcesApi as LRApi ,
@@ -179,7 +180,7 @@ const channels = {
179
180
details : ( channelType : string , name : string ) =>
180
181
`${ API_BASE_URL } /api/v0/channels/type/${ channelType } /${ name } /` ,
181
182
patch : ( id : number ) => `${ API_BASE_URL } /api/v0/channels/${ id } /` ,
182
- list : ( params ?: Params < ChannelsApi , "channelsList" > ) =>
183
+ list : ( params ?: Paramsv0 < ChannelsApi , "channelsList" > ) =>
183
184
`${ API_BASE_URL } /api/v0/channels/${ query ( params ) } ` ,
184
185
}
185
186
Original file line number Diff line number Diff line change 1
1
import React from "react"
2
2
import { Metadata } from "next"
3
-
4
3
import { AboutPage } from "@/app-pages/AboutPage/AboutPage"
5
4
import { standardizeMetadata } from "@/common/metadata"
6
5
Original file line number Diff line number Diff line change @@ -4,10 +4,7 @@ import { channelsApi } from "api/clients"
4
4
import { ChannelTypeEnum } from "api/v0"
5
5
import { getMetadataAsync } from "@/common/metadata"
6
6
import handleNotFound from "@/common/handleNotFound"
7
-
8
- type SearchParams = {
9
- [ key : string ] : string | string [ ] | undefined
10
- }
7
+ import type { PageParams } from "@/app/types"
11
8
12
9
type RouteParams = {
13
10
channelType : ChannelTypeEnum
@@ -17,10 +14,7 @@ type RouteParams = {
17
14
export async function generateMetadata ( {
18
15
searchParams,
19
16
params,
20
- } : {
21
- searchParams : Promise < SearchParams >
22
- params : Promise < RouteParams >
23
- } ) {
17
+ } : PageParams < RouteParams > ) {
24
18
const { channelType, name } = await params
25
19
26
20
const { data } = await handleNotFound (
Original file line number Diff line number Diff line change 1
1
import React from "react"
2
2
import DashboardPage from "@/app-pages/DashboardPage/DashboardPage"
3
-
4
3
import { Metadata } from "next"
5
4
import { standardizeMetadata } from "@/common/metadata"
6
5
import RestrictedRoute from "@/components/RestrictedRoute/RestrictedRoute"
Original file line number Diff line number Diff line change
1
+ export type SearchParams = {
2
+ [ key : string ] : string | string [ ] | undefined
3
+ }
4
+
5
+ export type PageParams < RouteParams = Record < string , never > > = {
6
+ params ?: Promise < RouteParams >
7
+ searchParams ?: Promise < SearchParams >
8
+ }
You can’t perform that action at this time.
0 commit comments