Convert BaseResource.save to return a promise.

Review Request #11642 — Created June 2, 2021 and updated

david
Review Board
master
reviewboard

This change updates the save machinery for various resources to use
promises and async/await instead of callbacks.

  • Ran js-tests.
  • Manually tested API token creation, comment editing, review request
    field editing, post-commit review request creation, ship-it revocation,
    and file attachment uploading.
Summary
Convert BaseResource.save to return a promise.
Description From Last Updated

Col: 15 'commit' was used before it was defined.

reviewbotreviewbot

Col: 39 Missing semicolon.

reviewbotreviewbot

Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()?

chipx86chipx86

Think this can be .and.rejectWith(new BackboneError(...))

chipx86chipx86

, optional?

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

david
david
david
chipx86
  1. Looks good. There's some Jasmine stuff we can probably use for making spies that resolve/reject. Only highlighted one instance of each.

    Doesn't have to be a blocker for this change.

  2. Does .and.resolveTo() work instead of having to explicitly return Promise.resolve()?

  3. Think this can be .and.rejectWith(new BackboneError(...))

  4. 
      
david
Review request changed
Loading...