TypeSciprt ile dynamic key tanimlamak
typescript, programming
TypeSciprt ile dynamic key tanimlamak
Typesciprt dilinde dynamic anahtar tanimlamasi icin [key]
yapisi kullanilir
Ornek Senaryo
async updateRelevantUrl(pageId: string, publisher: Publisher, url: string) {
const capitalizedPublisher = publisher.charAt(0).toUpperCase() + publisher.slice(1)
return await this.notionClient.pages.update({
page_id: pageId,
properties: {
[capitalizedPublisher]: { // [] seklinde olmasina dikkat edin
rich_text: [{ type: "text", text: { content: url } }]
}
}
})
}
Hatali Senaryo
PreviousType Alias Gösterimi Sorunu ve ÇözümüNextDeveloping Alfred5 workflow using alfred5 python package
Last updated
Was this helpful?