diff --git a/packages/restapi/src/lib/channels/subscribeV2.ts b/packages/restapi/src/lib/channels/subscribeV2.ts index ed4b4d857..ff78de795 100644 --- a/packages/restapi/src/lib/channels/subscribeV2.ts +++ b/packages/restapi/src/lib/channels/subscribeV2.ts @@ -94,13 +94,13 @@ export const subscribeV2 = async (options: SubscribeOptionsV2Type) => { }; - await axios.post(requestUrl, body); + const res = await axios.post(requestUrl, body); if (typeof onSuccess === 'function') onSuccess(); - return { status: 'success', message: 'successfully opted into channel' }; + return res; } catch (err) { - console.log(err); + // console.log(err); if (typeof onError === 'function') onError(err as Error); return { diff --git a/packages/restapi/src/lib/channels/unsubscribeV2.ts b/packages/restapi/src/lib/channels/unsubscribeV2.ts index e62cc2519..4910f7258 100644 --- a/packages/restapi/src/lib/channels/unsubscribeV2.ts +++ b/packages/restapi/src/lib/channels/unsubscribeV2.ts @@ -94,11 +94,11 @@ export const unsubscribeV2 = async (options: UnSubscribeOptionsV2Type) => { message: messageInformation.data, }; - await axios.post(requestUrl, body); + const res = await axios.post(requestUrl, body); if (typeof onSuccess === 'function') onSuccess(); - return { status: 'success', message: 'successfully opted out channel' }; + return res; } catch (err) { if (typeof onError === 'function') onError(err as Error);