-
Notifications
You must be signed in to change notification settings - Fork 17
Add support for the collection:delete API action #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## 7-dev #523 +/- ##
==========================================
- Coverage 95.59% 91.16% -4.44%
==========================================
Files 32 32
Lines 1318 1392 +74
Branches 0 129 +129
==========================================
+ Hits 1260 1269 +9
- Misses 58 98 +40
- Partials 0 25 +25
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicking
<br/> | ||
|
||
```js | ||
delete(index, collection, [options]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of options
can you pass? Also you should add this to the arguments table
code: true | ||
type: page | ||
title: delete | ||
description: Delete a collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: Delete a collection | |
description: Deletes a collection |
|
||
## Resolves | ||
|
||
Resolves if the collection is successfully delete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves if the collection is successfully delete. | |
Resolves if the collection is successfully deleted. |
template: default | ||
expected: Success | ||
|
||
sdk: js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line and the one below, we don't need them anymore
src/controllers/Collection.js
Outdated
action: 'delete' | ||
}; | ||
return this.query(request) | ||
.then(response => response.result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this should return undefined
src/controllers/Collection.js
Outdated
action: 'delete' | ||
}; | ||
return this.query(request) | ||
.then(undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then then
method take a callback as a parameter, passing undefined
will result to a TypeError
.
The promise resolved value will be this callback return value
.then(undefined); | |
.then(() => undefined); |
…t into collection-delete
# [7.4.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.4.0) (2020-08-18) #### New features - [ [#542](#542) ] Finalize typescript support ([Aschen](https://github.com/Aschen)) - [ [#529](#529) ] Add typescript support for protocols ([Aschen](https://github.com/Aschen)) #### Enhancements - [ [#541](#541) ] Add meaningful stacktrace ([Aschen](https://github.com/Aschen)) - [ [#537](#537) ] Add typescript support realtime ([Aschen](https://github.com/Aschen)) - [ [#531](#531) ] Add typescript support for Index and Collection controllers ([Aschen](https://github.com/Aschen)) - [ [#530](#530) ] Add typescript support for search results ([Aschen](https://github.com/Aschen)) - [ [#523](#523) ] Add support for the collection:delete API action ([morgandruesne](https://github.com/morgandruesne)) ---
What does this PR do?
This PR add the delete function and test for the Collection Controller