1 | var contentful = require('contentful-management')
|
2 | var client = contentful.createClient({
|
3 |
|
4 | accessToken: 'YOUR_ACCESS_TOKEN',
|
5 | })
|
6 |
|
7 | async function run() {
|
8 |
|
9 | var space = await client.getSpace('spaceId')
|
10 |
|
11 | await space.getEntries()
|
12 |
|
13 |
|
14 | await space.getContentType('product').then((contentType) => {
|
15 |
|
16 | contentType.name = 'New Product'
|
17 | return contentType.update().then((updatedContentType) => {
|
18 | console.log('Update was successful')
|
19 | return updatedContentType
|
20 | })
|
21 | })
|
22 | }
|
23 |
|
24 | run()
|