Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #132 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
fix get className in message action
  • Loading branch information
mgilangjanuar authored Dec 6, 2021
2 parents 6e7d6c9 + 44c2eef commit 39b93c3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "rimraf dist && eslint --fix -c .eslintrc.js --ext .ts . && tsc"
},
"dependencies": {
"@mgilangjanuar/telegram": "2.0.4",
"@mgilangjanuar/telegram": "2.0.9",
"@sentry/node": "^6.14.1",
"@sentry/tracing": "^6.14.1",
"@types/moment": "^2.13.0",
Expand Down
4 changes: 3 additions & 1 deletion server/src/api/v1/Messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export class Messages {
limit: Number(limit) || 0,
offsetId: Number(offset) || 0,
}))
return res.send({ messages })
const result = JSON.parse(JSON.stringify(messages))
result.messages = result.messages?.map((msg, i) => ({ ...msg, action: { ...msg.action, className: messages['messages'][i]?.action?.className } }))
return res.send({ messages: result })
}

@Endpoint.POST('/read/:type/:id', { middlewares: [Auth] })
Expand Down
13 changes: 13 additions & 0 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ import { runDB } from './model'
// }
// }

// const stringify = JSON.stringify
// JSON.stringify = str => {
// if (!str) return str
// try {
// const res = bigInt({ storeAsString: true }).stringify(str)
// return stringify(JSON.stringify(res))
// } catch (error) {
// console.error('FATAL JSON.stringify:', str)
// return stringify(str)
// }
// }


runDB()

const app = express()
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1544,10 +1544,10 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"

"@mgilangjanuar/telegram@2.0.4":
version "2.0.4"
resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.0.4/d17208e5ff0f9107bfdb485f88d235bedd57e3f37783e89d58889de59939f765#6049e301672092b3d7b9d8807e22fbac566ee0d2"
integrity sha512-3Uf0N4PAUoBX286BohyZ0g5yLJp+LQlhBij0K68eZPT6R/XUV1PjXU+/WsVSehYjx6Kk6yeU8oiuyOVQ8mS8NQ==
"@mgilangjanuar/telegram@2.0.9":
version "2.0.9"
resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.0.9/7de66d2ca37cf1bed8f889157d8e6c07cc53fc6477a2cfcf6e68ee7c839c0514#0087d944d7d1ed8bd4db9e580d43148d8580a7f0"
integrity sha512-COHrncMWDFdmUhWQUAODs7AtcSPw9ngMXzULdmf9cYlxDrX+mOh8boyl2js/nIdRl2U2hKxq9HwmVz13DBDovw==
dependencies:
"@cryptography/aes" "^0.1.1"
async-mutex "^0.3.0"
Expand Down

0 comments on commit 39b93c3

Please sign in to comment.