|
@ -11,6 +11,7 @@ import { fetchErrorHandler } from "./FetchErrorHandler"; |
|
|
import { EncryptionService } from "../service/EncryptionService"; |
|
|
import { EncryptionService } from "../service/EncryptionService"; |
|
|
import { SJCLEncryptionService } from "../service/SJCLEncryptionService"; |
|
|
import { SJCLEncryptionService } from "../service/SJCLEncryptionService"; |
|
|
import { ChatModel } from "./ChatModel" |
|
|
import { ChatModel } from "./ChatModel" |
|
|
|
|
|
import { Sprintf } from "../singleton/Sprintf"; |
|
|
export class ChatModelHelper { |
|
|
export class ChatModelHelper { |
|
|
private static readonly _encryptionService: EncryptionService = new SJCLEncryptionService(); |
|
|
private static readonly _encryptionService: EncryptionService = new SJCLEncryptionService(); |
|
|
|
|
|
|
|
@ -46,7 +47,14 @@ export class ChatModelHelper { |
|
|
return; |
|
|
return; |
|
|
}; |
|
|
}; |
|
|
headers.append('X-AUTH-TOKEN', JsonAPI.authToken); |
|
|
headers.append('X-AUTH-TOKEN', JsonAPI.authToken); |
|
|
const response = await fetch(`${JsonAPI.CHAT_MESSAGES_GET}/${toUser}`, { |
|
|
|
|
|
|
|
|
// const url = Sprintf(JsonAPI.CHAT_MESSAGES_GET, toUser);
|
|
|
|
|
|
const url = Sprintf(JsonAPI.CHAT_MESSAGE_PAGE_GET, toUser,1,5); |
|
|
|
|
|
log.debug(url) |
|
|
|
|
|
// const response = await fetch(`${JsonAPI.CHAT_MESSAGES_GET}/${toUser}`, {
|
|
|
|
|
|
// method: 'GET',
|
|
|
|
|
|
// headers: headers
|
|
|
|
|
|
// });
|
|
|
|
|
|
const response = await fetch(url, { |
|
|
method: 'GET', |
|
|
method: 'GET', |
|
|
headers: headers |
|
|
headers: headers |
|
|
}); |
|
|
}); |
|
|