You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -344,6 +344,45 @@ client
344
344
.catch((err) =>console.error(err));
345
345
```
346
346
347
+
#### Create closed content
348
+
349
+
By specifying the `isClosed` property, the content can be registered as archived.
350
+
351
+
> **Note:**`isDraft` and `isClosed` are mutually exclusive. Do not pass both as `true`; the SDK rejects that combination at runtime with an error. When using `isClosed: true`, omit `isDraft` or set it to `false` (the default).
352
+
353
+
```javascript
354
+
client
355
+
.create({
356
+
endpoint:'endpoint',
357
+
content: {
358
+
title:'title',
359
+
body:'body',
360
+
},
361
+
isClosed:true,
362
+
})
363
+
.then((res) =>console.log(res.id))
364
+
.catch((err) =>console.error(err));
365
+
```
366
+
367
+
#### Create closed content with specified ID
368
+
369
+
By specifying the `contentId` and `isClosed` properties, the content can be registered as archived with a specified ID. The same rule applies as above: `isDraft` and `isClosed` cannot both be `true`.
370
+
371
+
```javascript
372
+
client
373
+
.create({
374
+
endpoint:'endpoint',
375
+
contentId:'contentId',
376
+
content: {
377
+
title:'title',
378
+
body:'body',
379
+
},
380
+
isClosed:true,
381
+
})
382
+
.then((res) =>console.log(res.id))
383
+
.catch((err) =>console.error(err));
384
+
```
385
+
347
386
### Update content
348
387
349
388
The `update` method is used to update a single content specified by its ID.
0 commit comments