Skip to content

Commit c8a61e7

Browse files
Add readme for search() usage and add capability to override the previous search string in same request
1 parent 92537e7 commit c8a61e7

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,18 @@ client
222222
})
223223
````
224224

225+
226+
### $search
227+
Pass a search query string to `.search()` for searching in collections. Calling search multiple times will override previous search query. Refer graph [documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/query_parameters#search-parameter) for more.
228+
```js
229+
client
230+
.api("/me/messages")
231+
.search("from:admin")
232+
.get((err, res) => {
233+
console.log(res);
234+
});
235+
```
236+
225237
## Other API methods
226238

227239
### .version()

lib/graph-js-sdk-core.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/graph-js-sdk-web.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/GraphRequest.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/GraphRequest.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GraphRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class GraphRequest {
164164
}
165165

166166
search(searchStr: string): GraphRequest {
167-
this.addCsvQueryParameter("$search", `"${searchStr}"`, arguments);
167+
this.urlComponents.oDataQueryParams["$search"] = `"${searchStr}"`;
168168
return this;
169169
}
170170

0 commit comments

Comments
 (0)