Skip to content

Commit 757a327

Browse files
committed
docs: Add examples for creating closed content
1 parent 056dbb3 commit 757a327

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,43 @@ client
344344
.catch((err) => console.error(err));
345345
```
346346

347+
#### Create closed content
348+
349+
By specifying the `isClosed` property, the content can be registered as archived.
350+
351+
```javascript
352+
client
353+
.create({
354+
endpoint: 'endpoint',
355+
content: {
356+
title: 'title',
357+
body: 'body',
358+
},
359+
isClosed: true,
360+
})
361+
.then((res) => console.log(res.id))
362+
.catch((err) => console.error(err));
363+
```
364+
365+
#### Create closed content with specified ID
366+
367+
By specifying the `contentId` and `isClosed` properties, the content can be registered as archived with a specified ID.
368+
369+
```javascript
370+
client
371+
.create({
372+
endpoint: 'endpoint',
373+
contentId: 'contentId',
374+
content: {
375+
title: 'title',
376+
body: 'body',
377+
},
378+
isClosed: true,
379+
})
380+
.then((res) => console.log(res.id))
381+
.catch((err) => console.error(err));
382+
```
383+
347384
### Update content
348385

349386
The `update` method is used to update a single content specified by its ID.

README_jp.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,43 @@ client
344344
.catch((err) => console.error(err));
345345
```
346346

347+
#### 公開終了のステータスでコンテンツを登録
348+
349+
`isClosed`プロパティを使用することで、公開終了のステータスでコンテンツを登録できます。
350+
351+
```javascript
352+
client
353+
.create({
354+
endpoint: 'endpoint',
355+
content: {
356+
title: 'タイトル',
357+
body: '本文',
358+
},
359+
isClosed: true,
360+
})
361+
.then((res) => console.log(res.id))
362+
.catch((err) => console.error(err));
363+
```
364+
365+
#### 指定されたIDかつ公開終了のステータスでコンテンツを登録
366+
367+
`contentId`プロパティと`isClosed`プロパティを使用することで、指定されたIDかつ公開終了のステータスでコンテンツを登録できます。
368+
369+
```javascript
370+
client
371+
.create({
372+
endpoint: 'endpoint',
373+
contentId: 'contentId',
374+
content: {
375+
title: 'タイトル',
376+
body: '本文',
377+
},
378+
isClosed: true,
379+
})
380+
.then((res) => console.log(res.id))
381+
.catch((err) => console.error(err));
382+
```
383+
347384
### コンテンツの編集
348385

349386
`update`メソッドは特定のコンテンツを編集するために使用します。

0 commit comments

Comments
 (0)