Closed ptreitler closed 2 years ago
Hi @ptreitler
I just had a quick look and it looks like that status is not assignable via the SDK.
I will update this issue as soon as this has been fixed on the SDK
As a work around until it is updated, you can do the following:
const entry = await flamelinkApp.content
.add({
schemaKey: "mySchema",
data: {
...
},
})
// NOTE: using the firebaseApp and not the FlamelinkApp below
firebase
.firestore()
.collection("fl_content")
.doc(entry._fl_meta_.docId)
.update({ "_fl_meta_.status": "draft" });
Thanks for the quick reply and workaround @gitdubz, I'll try that in the meantime.
Hi @ptreitler
A new version of the sdk has been released (1.0.0-rc.1)
You can update or install the latest (npm install flamelink@next)
https://flamelink.github.io/flamelink-js-sdk/#/content?id=add
you will notice the new status
parameter that can be passed
app.content.add({
schemaKey: 'blogPost',
data: {
title: 'New Post',
},
status: 'draft',
})
I want to add data to Flamelink in the "Draft" status in my app, but I haven't found a way to do so using the API. I can read the status on my data just fine via
_fl_meta_.status
, but there doesn't seem to be a way to set this attribute inflamelinkApp.content.add
.I have tried passing it as part of the data:
...but this seems to get ignored as it doesn't show up in the CMS or the Cloud Firestore.