Skip to content

Commit 725c896

Browse files
committed
fmt
1 parent 8ba15fd commit 725c896

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sqlpage/tomselect.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ function sqlpage_select_dropdown() {
4040
function sqlpage_load_options_source(options_source) {
4141
if (!options_source) return;
4242
return async (query, callback) => {
43-
const err = (label) =>
44-
callback([{ label, value: "" }]);
43+
const err = (label) => callback([{ label, value: "" }]);
4544
const resp = await fetch(
4645
`${options_source}?search=${encodeURIComponent(query)}`,
4746
);
@@ -67,7 +66,11 @@ function sqlpage_load_options_source(options_source) {
6766
}
6867
if (results.length > 0) {
6968
const keys = Object.keys(results[0]);
70-
if (keys.length !== 2 || !keys.includes("label") || !keys.includes("value")) {
69+
if (
70+
keys.length !== 2 ||
71+
!keys.includes("label") ||
72+
!keys.includes("value")
73+
) {
7174
return err(
7275
`Invalid response from "${options_source}". The response must be an array of objects with a 'label' and a 'value' property. Got: ${JSON.stringify(results[0])} in the first object instead.`,
7376
);

0 commit comments

Comments
 (0)