Wappler Version: 6.3.2 Stable and Beta
Operating System: Windows 11
Server Model: Node / Capacitor
Database Type: Postgres
Hosting Type: Docker / DO
I have a Contact table with a Label multi reference field.
Expected behavior
When selecting one Label and clicking apply the Server Connect should add the one Label to the Contact_Label
junction table.
Actual behavior
For some strange reason, the Label(s) are only added when I submit more than one Label. With one label the Contacts Server Connect shows a 200 response, but when checking the junction table the record is not added.
If I select more than one Label, then both labels are added to the junction table correctly.
The same issue happens when attempting to remove the labels.
How to reproduce
- Create a Contact table.
- Create a Label table.
- Create a multi reference field on the Contact table to the Label table.
- Create an update API that will modify the Contact table and add the Labels to the $_POST.Label field on the Contact table.
Here’s the form code.
<form is="dmx-serverconnect-form" method="post" id="ContactLabelUpdater" action="https://dev.brightyard.co/api/v1/contacts" site="brightyard-server-v3" credentials="true" dmx-on:success="ContactsFlow.run({label: query.l, search: query.s, type: query.t})">
<ul class="link-list-opt no-bdr ps-2 pe-2">
<li dmx-repeat:labels="GetContactLabel.data.contactlabels">
<div class="dropdown-item custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input nk-dt-item-check" name="Label" dmx-bind:id="LabelChecked-{{$index}}" dmx-bind:checked="data_detail_contact.data.FormattedLabels.contains(FormattedName)" dmx-bind:value="LabelId">
<label class="custom-control-label" dmx-bind:for="LabelChecked-{{$index}}">{{FormattedName}}</label>
</div>
</li>
<li class="divider"></li>
<li><button class="btn btn-outline-primary w-100" type="submit">Apply</button></li>
</ul>
<input type="hidden" id="ContactLabelUpdaterContactId" name="ContactId" dmx-bind:value="data_detail_contact.data.ContactId">
</form>