1
- import type {
2
- AdminViewComponent ,
3
- AdminViewProps ,
4
- EditViewComponent ,
5
- ServerSideEditViewProps ,
6
- } from 'payload'
1
+ import type { AdminViewComponent , AdminViewProps , EditViewComponent } from 'payload'
7
2
8
- import {
9
- DocumentInfoProvider ,
10
- EditDepthProvider ,
11
- FormQueryParamsProvider ,
12
- HydrateClientUser ,
13
- } from '@payloadcms/ui'
3
+ import { DocumentInfoProvider , EditDepthProvider , HydrateClientUser } from '@payloadcms/ui'
14
4
import { RenderCustomComponent , isEditing as getIsEditing } from '@payloadcms/ui/shared'
15
5
import { notFound , redirect } from 'next/navigation.js'
16
6
import React from 'react'
@@ -65,7 +55,6 @@ export const Document: React.FC<AdminViewProps> = async ({
65
55
let ErrorView : AdminViewComponent
66
56
67
57
let apiURL : string
68
- let action : string
69
58
70
59
const { data, formState } = await getDocumentData ( {
71
60
id,
@@ -88,8 +77,6 @@ export const Document: React.FC<AdminViewProps> = async ({
88
77
notFound ( )
89
78
}
90
79
91
- action = `${ serverURL } ${ apiRoute } /${ collectionSlug } ${ isEditing ? `/${ id } ` : '' } `
92
-
93
80
const params = new URLSearchParams ( )
94
81
if ( collectionConfig . versions ?. drafts ) {
95
82
params . append ( 'draft' , 'true' )
@@ -128,8 +115,6 @@ export const Document: React.FC<AdminViewProps> = async ({
128
115
notFound ( )
129
116
}
130
117
131
- action = `${ serverURL } ${ apiRoute } /globals/${ globalSlug } `
132
-
133
118
const params = new URLSearchParams ( {
134
119
locale : locale ?. code ,
135
120
} )
@@ -198,7 +183,6 @@ export const Document: React.FC<AdminViewProps> = async ({
198
183
199
184
return (
200
185
< DocumentInfoProvider
201
- action = { action }
202
186
apiURL = { apiURL }
203
187
collectionSlug = { collectionConfig ?. slug }
204
188
disableActions = { false }
@@ -225,34 +209,25 @@ export const Document: React.FC<AdminViewProps> = async ({
225
209
depth = { 1 }
226
210
key = { `${ collectionSlug || globalSlug } ${ locale ?. code ? `-${ locale ?. code } ` : '' } ` }
227
211
>
228
- < FormQueryParamsProvider
229
- initialParams = { {
230
- depth : 0 ,
231
- 'fallback-locale' : 'null' ,
232
- locale : locale ?. code ,
233
- uploadEdits : undefined ,
234
- } }
235
- >
236
- { ErrorView ? (
237
- < ErrorView initPageResult = { initPageResult } searchParams = { searchParams } />
238
- ) : (
239
- < RenderCustomComponent
240
- CustomComponent = { ViewOverride || CustomView }
241
- DefaultComponent = { DefaultView }
242
- serverOnlyProps = { {
243
- i18n,
244
- initPageResult,
245
- locale,
246
- params,
247
- payload,
248
- permissions,
249
- routeSegments : segments ,
250
- searchParams,
251
- user,
252
- } }
253
- />
254
- ) }
255
- </ FormQueryParamsProvider >
212
+ { ErrorView ? (
213
+ < ErrorView initPageResult = { initPageResult } searchParams = { searchParams } />
214
+ ) : (
215
+ < RenderCustomComponent
216
+ CustomComponent = { ViewOverride || CustomView }
217
+ DefaultComponent = { DefaultView }
218
+ serverOnlyProps = { {
219
+ i18n,
220
+ initPageResult,
221
+ locale,
222
+ params,
223
+ payload,
224
+ permissions,
225
+ routeSegments : segments ,
226
+ searchParams,
227
+ user,
228
+ } }
229
+ />
230
+ ) }
256
231
</ EditDepthProvider >
257
232
</ DocumentInfoProvider >
258
233
)
0 commit comments