Skip to content

Commit

Permalink
fix unknown operation message, jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed May 7, 2024
1 parent 6dd4aa2 commit 04062e7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Deprecated `firestorm.table(name)` method, since `firestorm.collection(name)` does exactly the same thing.
- Reformatted the repository and improved README.md to make it easier to set up Firestorm.
- Clean up and standardize JSDoc comments.
- `editField` and `editFieldBulk` now return confirmations like all other write methods
- `editField` and `editFieldBulk` now return confirmations like all other write methods.
- `editField` and `editFieldBulk` now reject with a descriptive error message on failure rather than silently failing.

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion php/classes/JSONDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ private function _edit(&$obj, $editObj): bool {
break;
}

throw new HTTPException("Edit failed on field $field with ID $id", 400);
throw new HTTPException("Unknown operation $operation", 400);
}

public function editField($editObj) {
Expand Down
1 change: 1 addition & 0 deletions php/get.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
// import db config
require_once './config.php';

// HTTPExceptions get properly handled in the catch
try {

// checking good collection
Expand Down
2 changes: 1 addition & 1 deletion php/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// import db config
require_once './config.php';

// trying things
// HTTPExceptions get properly handled in the catch
try {

// checking good collection
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ class Collection {
/**
* Edit an element's field in the collection
* @param {EditFieldOption} option - The edit object
* @returns {Promise<{ success: boolean }>} Edit confirmation
* @returns {Promise<WriteConfirmation>} Edit confirmation
*/
editField(option) {
const data = this.__write_data("editField", option, null);
Expand All @@ -518,7 +518,7 @@ class Collection {
/**
* Edit multiple elements' fields in the collection
* @param {EditFieldOption[]} options - The edit objects
* @returns {Promise<{ success: boolean[] }>} Edit confirmation
* @returns {Promise<WriteConfirmation>} Edit confirmation
*/
editFieldBulk(options) {
const data = this.__write_data("editFieldBulk", options, undefined);
Expand Down

0 comments on commit 04062e7

Please sign in to comment.