Skip to content

Commit 312ba54

Browse files
committed
fix: add unsupported attribute error
1 parent 93ffb24 commit 312ba54

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

templates/cli/lib/commands/push.js.twig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ const createAttribute = (databaseId, collectionId, attribute) => {
568568
onDelete: attribute.onDelete,
569569
parseOutput: false
570570
})
571+
default:
572+
throw new Error(`Unsupported attribute type: ${attribute.type}`);
571573
}
572574
}
573575

@@ -641,7 +643,7 @@ const updateAttribute = (databaseId, collectionId, attribute) => {
641643
array: attribute.array,
642644
parseOutput: false
643645
})
644-
case 'double':
646+
case 'float':
645647
return databasesUpdateFloatAttribute({
646648
databaseId,
647649
collectionId,
@@ -685,6 +687,8 @@ const updateAttribute = (databaseId, collectionId, attribute) => {
685687
onDelete: attribute.onDelete,
686688
parseOutput: false
687689
})
690+
default:
691+
throw new Error(`Unsupported attribute type: ${attribute.type}`);
688692
}
689693
}
690694
const deleteAttribute = async (collection, attribute, isIndex = false) => {
@@ -753,7 +757,7 @@ const checkAttributeChanges = (remote, local, collection, recraeting = true) =>
753757

754758
if (changeableKeys.includes(key)) {
755759
if (!recraeting) {
756-
reason += compareAttribute(remote[key], local[key], reason, key)
760+
reason = compareAttribute(remote[key], local[key], reason, key)
757761
}
758762
continue;
759763
}
@@ -762,7 +766,7 @@ const checkAttributeChanges = (remote, local, collection, recraeting = true) =>
762766
continue;
763767
}
764768

765-
reason += compareAttribute(remote[key], local[key], reason, key)
769+
reason = compareAttribute(remote[key], local[key], reason, key)
766770
}
767771

768772
return reason === '' ? undefined : { key: keyName, attribute, reason, action };

0 commit comments

Comments
 (0)