File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import CONFIG from "../../../config";
55import {
66 EmailHeaders ,
77 Message ,
8+ MessageListOptions ,
89 MessageUpdateParams ,
910 Report ,
1011 SpamReport ,
@@ -58,10 +59,16 @@ export default class MessagesApi {
5859 /**
5960 * Gets all messages in inboxes.
6061 */
61- public async get ( inboxId : number ) {
62+ public async get ( inboxId : number , options ?: MessageListOptions ) {
6263 const url = `${ this . messagesURL } /${ inboxId } /messages` ;
6364
64- return this . client . get < Message [ ] , Message [ ] > ( url ) ;
65+ const params = {
66+ ...( options ?. last_id !== undefined && { last_id : options . last_id } ) ,
67+ ...( options ?. page !== undefined && { page : options . page } ) ,
68+ ...( options ?. search && { search : options . search } ) ,
69+ } ;
70+
71+ return this . client . get < Message [ ] , Message [ ] > ( url , { params } ) ;
6572 }
6673
6774 /**
You can’t perform that action at this time.
0 commit comments