Template variables

Hi guys, I am using v8 locally, and have created a very simple Vue web application using embed.umd.min.js to view the in-app notifications and axios to trigger simple notifications. If I create a very simple template, with a title of 'Hello {{a}}' and trigger an event with the following payload:
payload: {
a: "a",
b: "b",
c: "c"
}
payload: {
a: "a",
b: "b",
c: "c"
}
I get a notification that just says 'Hello ' and the passed payload attribute is not included, but what is interesting is that I noticed the following payload returned from the API is (note that the a attribute is missing)
payload: {
a: "",
b: "b",
c: "c"
}
payload: {
a: "",
b: "b",
c: "c"
}
If I update the title of the in-app notification to 'Hello {{b}}' and trigger the very same event, I see the same text in the notification 'Hello ' and the following payload returned by the API is:
payload: {
a: "a",
b: "",
c: "c"
}
payload: {
a: "a",
b: "",
c: "c"
}
Each time, the variable included in the template is removed from the payload that is saved to mongodb. Am I doing something wrong? The request is
13 Replies
dmulligan
dmulligan2y ago
And the API response is
dmulligan
dmulligan2y ago
dmulligan
dmulligan2y ago
The template is:
dmulligan
dmulligan2y ago
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Gali Baum
Gali Baum2y ago
Hi! Are you using the self hosted version? Also, could you please check what happens if you put something in the default value (in the variables table at the bottom)?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
dmulligan
dmulligan2y ago
If a default value is configured that value willl be displayed in the outputted message regardless of sending the attribute in the payload. If the value is marked as required, an error will be returned if the value is not sent it the payload, but regardless, the value if sent will not be displayed.
Gali Baum
Gali Baum2y ago
Yes, this was already fixed, today-tomorrow v0.9.0 will be released and you should not have this problem anymore
dmulligan
dmulligan2y ago
That is great news, thank you very much for your help.
Novu_Bot
Novu_Bot2y ago
@dmulligan, you just advanced to level 1!
dmulligan
dmulligan2y ago
Just to update, this is confirmed as fixed in v0.9, thanks again for your help.
Gali Baum
Gali Baum2y ago
Thanks for the update!
Want results from more Discord servers?
Add your server
More Posts