Browse Source

parse int chat status

push-params
Evan Feenstra 5 years ago
parent
commit
ec70df486e
  1. 6
      api/controllers/chats.ts
  2. 6
      dist/api/controllers/chats.js
  3. 2
      dist/api/controllers/chats.js.map

6
api/controllers/chats.ts

@ -276,9 +276,9 @@ export const deleteChat = async (req, res) => {
return failure(res, "cannot leave your own tribe")
}
console.log("DELETE CHAT STAUS",chat.status)
const isPending = chat.status===constants.chat_types.pending
const isRejected = chat.status===constants.chat_types.rejected
console.log("DELETE CHAT STAUS",chat.status,typeof chat.status)
const isPending = parseInt(chat.status)===constants.chat_types.pending
const isRejected = parseInt(chat.status)===constants.chat_types.rejected
console.log("is pending",isPending,"is rejected",isRejected)
if(!isPending && !isRejected) { // dont send if pending
network.sendMessage({

6
dist/api/controllers/chats.js

@ -270,9 +270,9 @@ exports.deleteChat = (req, res) => __awaiter(void 0, void 0, void 0, function* (
if (owner.publicKey === tribeOwnerPubKey) {
return res_1.failure(res, "cannot leave your own tribe");
}
console.log("DELETE CHAT STAUS", chat.status);
const isPending = chat.status === constants.chat_types.pending;
const isRejected = chat.status === constants.chat_types.rejected;
console.log("DELETE CHAT STAUS", chat.status, typeof chat.status);
const isPending = parseInt(chat.status) === constants.chat_types.pending;
const isRejected = parseInt(chat.status) === constants.chat_types.rejected;
console.log("is pending", isPending, "is rejected", isRejected);
if (!isPending && !isRejected) { // dont send if pending
network.sendMessage({

2
dist/api/controllers/chats.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save