@@ -48,7 +48,6 @@ export const seed = async ({
48
48
data : {
49
49
navItems : [ ] ,
50
50
} ,
51
- req,
52
51
} )
53
52
}
54
53
@@ -60,18 +59,14 @@ export const seed = async ({
60
59
exists : true ,
61
60
} ,
62
61
} ,
63
- req,
64
62
} )
65
63
}
66
64
67
65
const pages = await payload . delete ( {
68
66
collection : 'pages' ,
69
67
where : { } ,
70
- req,
71
68
} )
72
69
73
- console . log ( { pages } )
74
-
75
70
payload . logger . info ( `— Seeding demo author and user...` )
76
71
77
72
await payload . delete ( {
@@ -81,7 +76,6 @@ export const seed = async ({
81
76
equals : 'demo-author@payloadcms.com' ,
82
77
} ,
83
78
} ,
84
- req,
85
79
} )
86
80
87
81
const demoAuthor = await payload . create ( {
@@ -91,7 +85,6 @@ export const seed = async ({
91
85
email : 'demo-author@payloadcms.com' ,
92
86
password : 'password' ,
93
87
} ,
94
- req,
95
88
} )
96
89
97
90
let demoAuthorID : number | string = demoAuthor . id
@@ -111,34 +104,11 @@ export const seed = async ({
111
104
'https://raw.githubusercontent.com/payloadcms/payload/refs/heads/main/templates/website/src/endpoints/seed/image-hero1.webp' ,
112
105
) ,
113
106
] )
114
- // Log all but not the buffer
115
- req . payload . logger . info ( {
116
- image1Buffer : {
117
- name : image1Buffer . name ,
118
- mimetype : image1Buffer . mimetype ,
119
- size : image1Buffer . size ,
120
- } ,
121
- image2Buffer : {
122
- name : image2Buffer . name ,
123
- mimetype : image2Buffer . mimetype ,
124
- size : image2Buffer . size ,
125
- } ,
126
- image3Buffer : {
127
- name : image3Buffer . name ,
128
- mimetype : image3Buffer . mimetype ,
129
- size : image3Buffer . size ,
130
- } ,
131
- hero1Buffer : {
132
- name : hero1Buffer . name ,
133
- mimetype : hero1Buffer . mimetype ,
134
- size : hero1Buffer . size ,
135
- } ,
136
- } )
107
+
137
108
const image1Doc = await payload . create ( {
138
109
collection : 'media' ,
139
110
data : image1 ,
140
111
file : image1Buffer ,
141
- req,
142
112
} )
143
113
const image2Doc = await payload . create ( {
144
114
collection : 'media' ,
@@ -150,13 +120,11 @@ export const seed = async ({
150
120
collection : 'media' ,
151
121
data : image2 ,
152
122
file : image3Buffer ,
153
- req,
154
123
} )
155
124
const imageHomeDoc = await payload . create ( {
156
125
collection : 'media' ,
157
126
data : image2 ,
158
127
file : hero1Buffer ,
159
- req,
160
128
} )
161
129
162
130
payload . logger . info ( `— Seeding categories...` )
@@ -165,47 +133,41 @@ export const seed = async ({
165
133
data : {
166
134
title : 'Technology' ,
167
135
} ,
168
- req,
169
136
} )
170
137
171
138
const newsCategory = await payload . create ( {
172
139
collection : 'categories' ,
173
140
data : {
174
141
title : 'News' ,
175
142
} ,
176
- req,
177
143
} )
178
144
179
145
const financeCategory = await payload . create ( {
180
146
collection : 'categories' ,
181
147
data : {
182
148
title : 'Finance' ,
183
149
} ,
184
- req,
185
150
} )
186
151
187
152
await payload . create ( {
188
153
collection : 'categories' ,
189
154
data : {
190
155
title : 'Design' ,
191
156
} ,
192
- req,
193
157
} )
194
158
195
159
await payload . create ( {
196
160
collection : 'categories' ,
197
161
data : {
198
162
title : 'Software' ,
199
163
} ,
200
- req,
201
164
} )
202
165
203
166
await payload . create ( {
204
167
collection : 'categories' ,
205
168
data : {
206
169
title : 'Engineering' ,
207
170
} ,
208
- req,
209
171
} )
210
172
211
173
let image1ID : number | string = image1Doc . id
@@ -233,7 +195,6 @@ export const seed = async ({
233
195
. replace ( / " \{ \{ I M A G E _ 2 \} \} " / g, String ( image2ID ) )
234
196
. replace ( / " \{ \{ A U T H O R \} \} " / g, String ( demoAuthorID ) ) ,
235
197
) ,
236
- req,
237
198
} )
238
199
239
200
const post2Doc = await payload . create ( {
@@ -244,7 +205,6 @@ export const seed = async ({
244
205
. replace ( / " \{ \{ I M A G E _ 2 \} \} " / g, String ( image3ID ) )
245
206
. replace ( / " \{ \{ A U T H O R \} \} " / g, String ( demoAuthorID ) ) ,
246
207
) ,
247
- req,
248
208
} )
249
209
250
210
const post3Doc = await payload . create ( {
@@ -255,7 +215,6 @@ export const seed = async ({
255
215
. replace ( / " \{ \{ I M A G E _ 2 \} \} " / g, String ( image1ID ) )
256
216
. replace ( / " \{ \{ A U T H O R \} \} " / g, String ( demoAuthorID ) ) ,
257
217
) ,
258
- req,
259
218
} )
260
219
261
220
// update each post with related posts
@@ -265,23 +224,20 @@ export const seed = async ({
265
224
data : {
266
225
relatedPosts : [ post2Doc . id , post3Doc . id ] ,
267
226
} ,
268
- req,
269
227
} )
270
228
await payload . update ( {
271
229
id : post2Doc . id ,
272
230
collection : 'posts' ,
273
231
data : {
274
232
relatedPosts : [ post1Doc . id , post3Doc . id ] ,
275
233
} ,
276
- req,
277
234
} )
278
235
await payload . update ( {
279
236
id : post3Doc . id ,
280
237
collection : 'posts' ,
281
238
data : {
282
239
relatedPosts : [ post1Doc . id , post2Doc . id ] ,
283
240
} ,
284
- req,
285
241
} )
286
242
287
243
payload . logger . info ( `— Seeding home page...` )
@@ -293,15 +249,13 @@ export const seed = async ({
293
249
. replace ( / " \{ \{ I M A G E _ 1 \} \} " / g, String ( imageHomeID ) )
294
250
. replace ( / " \{ \{ I M A G E _ 2 \} \} " / g, String ( image2ID ) ) ,
295
251
) ,
296
- req,
297
252
} )
298
253
299
254
payload . logger . info ( `— Seeding contact form...` )
300
255
301
256
const contactForm = await payload . create ( {
302
257
collection : 'forms' ,
303
258
data : JSON . parse ( JSON . stringify ( contactFormData ) ) ,
304
- req,
305
259
} )
306
260
307
261
let contactFormID : number | string = contactForm . id
@@ -317,7 +271,6 @@ export const seed = async ({
317
271
data : JSON . parse (
318
272
JSON . stringify ( contactPageData ) . replace ( / " \{ \{ C O N T A C T _ F O R M _ I D \} \} " / g, String ( contactFormID ) ) ,
319
273
) ,
320
- req,
321
274
} )
322
275
323
276
payload . logger . info ( `— Seeding header...` )
@@ -345,7 +298,6 @@ export const seed = async ({
345
298
} ,
346
299
] ,
347
300
} ,
348
- req,
349
301
} )
350
302
351
303
payload . logger . info ( `— Seeding footer...` )
@@ -379,7 +331,6 @@ export const seed = async ({
379
331
} ,
380
332
] ,
381
333
} ,
382
- req,
383
334
} )
384
335
385
336
payload . logger . info ( 'Seeded database successfully!' )
0 commit comments