2022-03-29 18:53:27 +00:00
|
|
|
import { IMessage } from '../../definitions';
|
2022-05-30 22:01:25 +00:00
|
|
|
import { Services } from '../services';
|
2021-06-15 20:13:42 +00:00
|
|
|
|
2022-03-29 18:53:27 +00:00
|
|
|
const getSingleMessage = (messageId: string): Promise<IMessage> =>
|
2021-10-01 18:12:19 +00:00
|
|
|
new Promise(async (resolve, reject) => {
|
|
|
|
try {
|
2022-05-30 22:01:25 +00:00
|
|
|
const result = await Services.getSingleMessage(messageId);
|
2021-10-01 18:12:19 +00:00
|
|
|
if (result.success) {
|
|
|
|
return resolve(result.message);
|
|
|
|
}
|
|
|
|
return reject();
|
|
|
|
} catch (e) {
|
|
|
|
return reject();
|
2021-06-15 20:13:42 +00:00
|
|
|
}
|
2021-10-01 18:12:19 +00:00
|
|
|
});
|
2021-06-15 20:13:42 +00:00
|
|
|
|
|
|
|
export default getSingleMessage;
|