Skip to content

Commit

Permalink
fix: add user filter to message timestamp and title subqueries (nocob…
Browse files Browse the repository at this point in the history
  • Loading branch information
deepure authored Feb 10, 2025
1 parent 9d21800 commit 6f5515a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function defineMyInAppChannels({ app }: { app: Application }) {
FROM ${messagesTableName} AS messages
WHERE
messages.${messagesFieldName.channelName} = ${channelsTableAliasName}.${channelsFieldName.name}
AND messages.${messagesFieldName.userId} = ${userId}
ORDER BY messages.${messagesFieldName.receiveTimestamp} DESC
LIMIT 1
)`;
Expand Down Expand Up @@ -118,6 +119,7 @@ export default function defineMyInAppChannels({ app }: { app: Application }) {
FROM ${messagesTableName} AS messages
WHERE
messages.${messagesFieldName.channelName} = ${channelsTableAliasName}.${channelsFieldName.name}
AND messages.${messagesFieldName.userId} = ${userId}
ORDER BY messages.${messagesFieldName.receiveTimestamp} DESC
LIMIT 1
)`),
Expand Down

0 comments on commit 6f5515a

Please sign in to comment.