Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 07683ca

Browse files
Increment version (patch) and fix indentation. Make direction mandatory.
1 parent 33f0c8c commit 07683ca

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.6",
2+
"version": "2.0.7",
33
"name": "onenoteapi",
44
"description": "JavaScript library to make calling the OneNote API easier.",
55
"main": "dist/OneNoteApi.js",

src/scripts/oneNoteApi.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,11 @@ export class OneNoteApi extends OneNoteApiBase implements IOneNoteApi {
225225
/**
226226
* GetNotebooksUrl
227227
*/
228-
private getNotebooksUrl(numExpands = 0,
229-
excludeReadOnlyNotebooks = true,
230-
orderByCondition = null): string {
228+
private getNotebooksUrl(numExpands = 0, excludeReadOnlyNotebooks = true, orderByCondition = null): string {
231229
// Since this url is most often used to save content to a specific notebook, by default
232230
// it does not include a notebook where user has Read only permissions.
233231
let filter = (excludeReadOnlyNotebooks) ? "$filter=userRole%20ne%20Microsoft.OneNote.Api.UserRole'Reader'" : "";
234-
let orderByStr = "";
235-
if (orderByCondition) {
236-
orderByStr = orderByCondition.direction ? `&$orderby=${orderByCondition.parameter}%20${orderByCondition.direction}` : `&$orderBy=${orderByCondition.parameter}`;
237-
}
238-
232+
let orderByStr = orderByCondition ? `&$orderby=${orderByCondition.parameter}%20${orderByCondition.direction}` : "";
239233
return "/me/notes/notebooks?" + filter + orderByStr + (numExpands ? "&" + this.getExpands(numExpands) : "");
240234
}
241235

src/scripts/orderBy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export enum Direction {
1515

1616
export class OrderBy {
1717
public parameter: Parameter;
18-
public direction?: Direction;
18+
public direction: Direction;
1919
}

0 commit comments

Comments
 (0)