@@ -209,8 +209,12 @@ Content-Type: application/json
209
209
"contentDate" : " 2023-05-28T13:56:55.360Z" ,
210
210
"contentDescription" : " contentTitle" ,
211
211
"contentCreators" : [
212
- " b9b61ca6-761b-4051-84b2-647a2262b78b" ,
213
- " a5326de3-d04c-425c-8711-0f99fc031c67"
212
+ {
213
+ "id" : " b9b61ca6-761b-4051-84b2-647a2262b78b"
214
+ },
215
+ {
216
+ "id" : " a5326de3-d04c-425c-8711-0f99fc031c67"
217
+ }
214
218
]
215
219
}
216
220
}
@@ -237,7 +241,110 @@ Content-Type: application/json
237
241
}
238
242
}
239
243
240
- ### View signle type
244
+ ### Create single type with the hasMany component for page
245
+ POST http://127.0.0.1:8001/ms/content
246
+ Accept: application/json
247
+ Content-Type: application/json
248
+
249
+ {
250
+ "id" : " 1" ,
251
+ "method" : " single-type.create" ,
252
+ "params" : {
253
+ "fields" : {
254
+ "components" : [
255
+ {
256
+ "id" : " dff2719e-3c57-4248-9408-59af6287a568"
257
+ }
258
+ ],
259
+ "title" : " Page single type" ,
260
+ "alias" : " pageSingleType" ,
261
+ "value" : {
262
+ "blogPostPage" : {
263
+ "id" : " dff2719e-3c57-4248-9408-59af6287a568" ,
264
+ "data" : {
265
+ "header" : {
266
+ "id" : " 9a7aedb4-4b00-44b3-89a3-a535692d28d6" ,
267
+ "data" : {
268
+ "pageHeader" : {
269
+ "id" : " 9a7aedb4-4b00-44b3-89a3-a535692d28d6" ,
270
+ "data" : {
271
+ "headerTitle" : " Cars" ,
272
+ "postNumber" : 1
273
+ }
274
+ }
275
+ }
276
+ },
277
+ "content" : {
278
+ "id" : " e6186469-a9a5-444c-812c-c801c95245b8" ,
279
+ "data" : {
280
+ "pageContent" : {
281
+ "id" : " e6186469-a9a5-444c-812c-c801c95245b8" ,
282
+ "data" : [
283
+ {
284
+ "contentTitle" : " Green Lamborghini" ,
285
+ "contentDate" : " 2023-05-28T13:56:55.360Z" ,
286
+ "contentDescription" : " contentTitle" ,
287
+ "contentCreators" : [
288
+ {
289
+ "id" : " b9b61ca6-761b-4051-84b2-647a2262b78b"
290
+ },
291
+ {
292
+ "id" : " a5326de3-d04c-425c-8711-0f99fc031c67"
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "contentTitle" : " White Lamborghini" ,
298
+ "contentDate" : " 2023-05-28T13:56:55.360Z" ,
299
+ "contentDescription" : " contentTitle" ,
300
+ "contentCreators" : [
301
+ {
302
+ "id" : " m9b61ca6-761b-4051-84b2-647a2262b78b"
303
+ },
304
+ {
305
+ "id" : " z5326de3-d04c-425c-8711-0f99fc031c67"
306
+ }
307
+ ]
308
+ },
309
+ {
310
+ "contentTitle" : " Blue Lamborghini" ,
311
+ "contentDate" : " 2023-05-28T13:56:55.360Z" ,
312
+ "contentDescription" : " contentTitle" ,
313
+ "contentCreators" : [
314
+ {
315
+ "id" : " p9b61ca6-761b-4051-84b2-647a2262b78b"
316
+ },
317
+ {
318
+ "id" : " o5326de3-d04c-425c-8711-0f99fc031c67"
319
+ }
320
+ ]
321
+ }
322
+ ]
323
+ }
324
+ }
325
+ },
326
+ "footer" : {
327
+ "id" : " 78567003-f8cb-4d92-8aab-d7c9dc88bf2e" ,
328
+ "data" : {
329
+ "id" : " 78567003-f8cb-4d92-8aab-d7c9dc88bf2e" ,
330
+ "pageFooter" : {
331
+ "contactUsWithTheEmail" :
" [email protected] " ,
332
+ "isThisPostRecommendedByUS" : true
333
+ }
334
+ }
335
+ },
336
+ "options" : {
337
+ "timeZoneId" : " America/Los_Angeles" ,
338
+ "timeZoneName" : " Pacific Daylight Time"
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+ }
346
+
347
+ ### View signle type with users (profile) relations
241
348
POST http://127.0.0.1:8001/ms/content
242
349
Accept: application/json
243
350
Content-Type: application/json
@@ -253,7 +360,36 @@ Content-Type: application/json
253
360
},
254
361
"payload" : {
255
362
"expand" : [
256
- " blogPostPage.content.pageContent.contentCreators"
363
+ {
364
+ "route" : " blogPostPage.content.pageContent.contentCreators" ,
365
+ "relations" : [" profile" ]
366
+ }
367
+ ]
368
+ }
369
+ }
370
+ }
371
+
372
+ ### View signle type with users atributes
373
+ ### NOTE: Provide always primary keys to attributes
374
+ POST http://127.0.0.1:8001/ms/content
375
+ Accept: application/json
376
+ Content-Type: application/json
377
+
378
+ {
379
+ "id" : " 1" ,
380
+ "method" : " single-type.view" ,
381
+ "params" : {
382
+ "query" : {
383
+ "where" : {
384
+ "id" : " 3cff317c-8ece-45b0-b0bb-0021760f06c2"
385
+ }
386
+ },
387
+ "payload" : {
388
+ "expand" : [
389
+ {
390
+ "route" : " blogPostPage.content.pageContent.contentCreators" ,
391
+ "attributes" : [" id" , " firstName" ]
392
+ }
257
393
]
258
394
}
259
395
}
@@ -541,3 +677,106 @@ Authorization: Bearer usertokenoooooooooooooooooooooon
541
677
}
542
678
}
543
679
}
680
+
681
+ ### Additional
682
+ ### Create single type for page with hasMany
683
+ POST http://127.0.0.1:8001/ms/content
684
+ Accept: application/json
685
+ Content-Type: application/json
686
+
687
+ {
688
+ "id" : " 1" ,
689
+ "method" : " single-type.create" ,
690
+ "params" : {
691
+ "fields" : {
692
+ "components" : [
693
+ {
694
+ "id" : " e5d4c33f-cd63-437a-a76b-bd798121ce15"
695
+ }
696
+ ],
697
+ "title" : " Page single type" ,
698
+ "alias" : " pageSingleTypeNew" ,
699
+ "value" : {
700
+ "blogPostPage" : {
701
+ "id" : " e5d4c33f-cd63-437a-a76b-bd798121ce15" ,
702
+ "data" : {
703
+ "header" : {
704
+ "id" : " 43edbae4-ec2f-4a32-a477-b1cfc8bb3673" ,
705
+ "data" : {
706
+ "pageHeader" : {
707
+ "id" : " 43edbae4-ec2f-4a32-a477-b1cfc8bb3673" ,
708
+ "data" : {
709
+ "headerTitle" : " Cars" ,
710
+ "postNumber" : 1
711
+ }
712
+ }
713
+ }
714
+ },
715
+ "content" : {
716
+ "id" : " cc896aa8-1734-4556-94c1-fcbf849d520c" ,
717
+ "data" : {
718
+ "pageContent" : {
719
+ "id" : " cc896aa8-1734-4556-94c1-fcbf849d520c" ,
720
+ "data" : [
721
+ {
722
+ "contentTitle" : " Green Lamborghini" ,
723
+ "contentDate" : " 2023-05-28T13:56:55.360Z" ,
724
+ "contentDescription" : " contentTitle1" ,
725
+ "contentCreators" : [
726
+ " a5326de3-d04c-425c-8711-0f99fc031c67"
727
+ ]
728
+ },
729
+ {
730
+ "contentTitle" : " Blue Lamborghini" ,
731
+ "contentDate" : " 2023-05-28T13:56:55.360Z" ,
732
+ "contentDescription" : " contentTitle2" ,
733
+ "contentCreators" : [
734
+ " b9b61ca6-761b-4051-84b2-647a2262b78b"
735
+ ]
736
+ }
737
+ ]
738
+ }
739
+ }
740
+ },
741
+ "footer" : {
742
+ "id" : " 1fddf950-159f-419c-b006-eb07a51f7857" ,
743
+ "data" : {
744
+ "id" : " 1fddf950-159f-419c-b006-eb07a51f7857" ,
745
+ "pageFooter" : {
746
+ "contactUsWithTheEmail" :
" [email protected] " ,
747
+ "isThisPostRecommendedByUS" : true
748
+ }
749
+ }
750
+ },
751
+ "options" : {
752
+ "timeZoneId" : " America/Los_Angeles" ,
753
+ "timeZoneName" : " Pacific Daylight Time"
754
+ }
755
+ }
756
+ }
757
+ }
758
+ }
759
+ }
760
+ }
761
+
762
+ ### View signle type
763
+ POST http://127.0.0.1:8001/ms/content
764
+ Accept: application/json
765
+ Content-Type: application/json
766
+
767
+ {
768
+ "id" : " 1" ,
769
+ "method" : " single-type.view" ,
770
+ "params" : {
771
+ "query" : {
772
+ "where" : {
773
+ "id" : " 8b4d7fa9-4f61-4f6f-9737-01546cd07b4e"
774
+ }
775
+ },
776
+ "payload" : {
777
+ "expand" : [
778
+ " blogPostPage.content.pageContent.contentCreators"
779
+ ]
780
+ }
781
+ }
782
+ }
0 commit comments