Skip to content

Commit

Permalink
In Report only show history for current user
Browse files Browse the repository at this point in the history
  • Loading branch information
imartinez2 committed Aug 12, 2023
1 parent 19a77ef commit 17c2202
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/features/reporting/reporting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ import {
MESSAGE_ATTRIBUTE,
} from "../chat/chat-services/models";
import { initDBContainer } from "../common/cosmos";
import { userHashedId } from "../auth/helpers";

export const FindAllChatThreadsForReporting = async (
pageSize = 10,
pageNumber = 0
) => {
const container = await initDBContainer();
const userId = await userHashedId();

const querySpec: SqlQuerySpec = {
query: `SELECT * FROM root r WHERE r.type=@type ORDER BY r.createdAt DESC OFFSET ${
query: `SELECT * FROM root r WHERE r.type=@type and r.userId=@userId ORDER BY r.createdAt DESC OFFSET ${
pageNumber * pageSize
} LIMIT ${pageSize}`,
parameters: [
{
name: "@type",
value: CHAT_THREAD_ATTRIBUTE,
},
{
name: "@userId",
value: userId,
},
],
};

Expand Down

0 comments on commit 17c2202

Please sign in to comment.