Commit Graph
358 Commits
Author SHA1 Message Date
G.Ambatte cff4f8eae5 Catch duplicate delete requests 2023-06-25 21:26:02 +12:00
G.Ambatte fa38d5c892 Additional info in errors 2023-06-25 20:39:36 +12:00
G.Ambatte 04eb7d0556 Add brew title to Not an Author page 2023-06-25 20:13:13 +12:00
G.Ambatte f175323221 Use common error object to reduce DRY 2023-06-25 18:22:22 +12:00
G.Ambatte e28b6e7a19 Differentiate Not an Author from Not logged in 2023-06-25 18:10:31 +12:00
G.Ambatte e5ef0aedd3 Pass all error properties to message generator 2023-06-25 17:10:25 +12:00
G.Ambatte da8e7ec610 Change Not an Author to 401 2023-06-25 16:51:17 +12:00
G.Ambatte 7efe8964f1 Change throw method, update HBErrors 2023-06-25 14:21:35 +12:00
G.Ambatte 853515e09e Switch Error gen from spread operator to func 2023-06-25 12:56:22 +12:00
Trevor Buckner f6c5354ce0 Add support for custom HBErrorCodes 2023-06-24 02:57:03 -04:00
G.Ambatte 9e1d53a30c Basic ErrorPage functionality 2023-06-19 21:06:38 +12:00
Trevor Buckner eaf7b9c4ef Change tests from .remove() to deleteOne() 2023-04-04 17:47:25 -04:00
G.Ambatte dce880610d Change Model.remove to Model.deleteOne 2023-04-02 20:57:03 +12:00
Trevor Buckner 298a10bc42 Clean up tests 2023-02-18 13:48:02 -05:00
G.Ambatte e751f9a25c Remove mocking function from homebrew.api.js 2023-02-17 17:42:56 +13:00
G.Ambatte 41db670e63 Add mock markModified when it does not exist 2023-02-17 16:14:33 +13:00
G.Ambatte 4b98c1ac89 Add markModified to fix authors array in DB 2023-02-17 11:26:11 +13:00
Charlie Humphreys 6bae21a578 Merge branch 'master' into client-server-version-mismatch-middleware 2023-01-21 00:26:18 -06:00
Charlie Humphreys 7755affa1e update based on feedback 2023-01-20 23:07:24 -06:00
Trevor Buckner c9241e2162 Fix Google Drive brews duplicating 2023-01-20 17:19:02 -05:00
Trevor Buckner da676c6ec1 Ensure getBrew returns an object if undefined 2023-01-12 13:33:55 -05:00
Trevor Buckner 901615d99e Remove extra console log for getGoogleBrew
App.js already logs the thrown error, so we were getting double logs (and Google errors are long....). This should make the logs a bit easier to sift through.
2023-01-10 21:08:21 -05:00
Trevor Buckner 6ed52f37cc Only fix stub if we actually found one. 2023-01-09 17:30:49 -05:00
Trevor Buckner 15e5a31767 If no stub exists, start stub as {}, not undefined
Recent changes to handle bad brew properties (tags as strings, no renderer, etc.) didn't account for the case where an old Google brew is first being stubbed; since no stub exists, there is no object to perform the corrections on, and we crash.
2023-01-09 14:53:35 -05:00
Trevor Buckner 8cbab4d4ce Fix saving issue when tags do not exist
Rare case where tags don't exist at all; gets confused in the step of converting tag strings to arrays
2023-01-09 14:12:57 -05:00
Trevor Buckner a9c28e84d0 Enable brew version mismatch checking on server
Was commented out previously to allow users time to update client code so the proper error displays
2023-01-09 10:30:07 -05:00
Charlie Humphreys 385bee964d adjust frontend error handling, add client/server mismatch middleware 2023-01-06 21:29:21 -06:00
Charlie Humphreys 676acb9e5a Merge branch 'master' into api-tests 2023-01-05 23:02:43 -06:00
Charlie Humphreys 387c468d84 add tests for deletion and address PR feedback 2023-01-05 22:56:54 -06:00
Trevor Buckner e02bde5eed Cleanup; added more fields to DEFAULT_BREW 2023-01-04 17:33:23 -05:00
Trevor Buckner 6dab5f836e Merge branch 'master' into pr/2429 2023-01-03 15:13:19 -05:00
Charlie Humphreys e47f81698c Merge branch 'master' into api-tests 2023-01-03 13:47:09 -06:00
Trevor Buckner 6eaf2feb40 Log version mismatch errors
To gauge how frequently they are occurring for future update.
2023-01-03 12:47:17 -05:00
Trevor Buckner 4fe0f1a7af Comment out server-side brew version checking
Requires client-side update to apply brew version correctly; temporarily disabling server-side checking for a few days until more users have updated their clients.
2023-01-03 12:38:00 -05:00
Charlie Humphreys ca03a473ec add check for truthy version, and make sure the version exists when incrementing it 2022-12-23 14:31:58 -06:00
Charlie Humphreys da9e20e96f add more tests and merge from main 2022-12-23 00:11:46 -06:00
Charlie Humphreys 925db96b08 Merge branch 'fixThemesDefault' into api-tests 2022-12-22 20:09:49 -06:00
G.Ambatte efdb8e07b0 Merge branch 'master' into fixThemesDefault 2022-12-23 13:03:31 +13:00
CharlieandTrevor Buckner 314f758d62 Update server/homebrew.api.js
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-12-22 15:58:33 -06:00
Charlie Humphreys 2f5bc8db54 remove redundant boolean comparison logic 2022-12-21 16:19:41 -06:00
Charlie Humphreys 7c61a27084 update authorship edit check and error 2022-12-21 15:59:00 -06:00
G.Ambatte f470a6185a Move default brew to app.js 2022-12-14 19:23:16 +13:00
Charlie Humphreys 63e043593a add invitedAuthors key and move invited author to authors on save 2022-12-13 21:05:00 -06:00
Charlie Humphreys 770d0c141d add 409 return when server version is greater than updating version
This also moves the version back onto the stub
2022-12-13 21:03:51 -06:00
G.Ambatte 0a885c8581 Merge branch 'master' into fixThemesDefault 2022-12-14 12:30:28 +13:00
Charlie Humphreys f847de852b Merge branch 'master' into disable-changes-from-non-authors 2022-12-12 10:39:08 -06:00
Trevor Buckner 747c976a14 typo 2022-12-12 10:19:49 -05:00
Trevor Buckner 326c28a11d Change findOneAndUpdate to FindOne and Save
Setting an object property to `undefined` should tell Mongoose to remove that property (for example, remove the googleId from a brew). That doesn't seem to work with `findOneAndUpdate` however; the `undefined` property remains after the update.

Switching back to `save()` to make this work again.
2022-12-12 09:59:04 -05:00
Charlie Humphreys a451e562fb add initial set of tests for api 2022-12-06 00:01:38 -06:00
Charlie Humphreys 6b8db74a2b add authors length check and account elvis operator 2022-12-05 22:31:56 -06:00