Adding an explicit type

This commit is contained in:
Keith Stevens
2023-01-14 18:14:29 +09:00
parent 7de25f299c
commit 5282c11827
+2 -1
View File
@@ -1,12 +1,13 @@
import { withRole } from "src/lib/auth";
import { oasstApiClient } from "src/lib/oasst_api_client";
import type { Message } from "src/types/Conversation";
/**
* Returns the messages recorded by the backend for a user.
*/
const handler = withRole("admin", async (req, res) => {
const { user } = req.query;
const messages = await oasstApiClient.fetch_user_messages(user as string);
const messages: Message[] = await oasstApiClient.fetch_user_messages(user as string);
res.status(200).json(messages);
});