Skip to content

Commit

Permalink
fix: 個別の回答表示ページで回答者をユーザー名で表示するように
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Jun 23, 2024
1 parent d5f2395 commit 6c35634
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ const AnswerDetails = (props: {
<Grid item xs={12}>
{props.answers.title}
</Grid>
{/* TODO: 回答者をユーザー名埋め込みに変える */}
<Grid item xs={6}>
<Typography sx={{ fontWeight: 'bold' }}>回答者</Typography>
{props.answers.uuid}
{props.answers.user.name}
</Grid>
<Grid item xs={6}>
<Typography sx={{ fontWeight: 'bold' }}>回答日時</Typography>
Expand Down
12 changes: 10 additions & 2 deletions src/app/api/_schemas/ResponseSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ export type GetQuestionsResponse = z.infer<typeof getQuestionsResponseSchema>;
// GET /forms/answers
export const getAnswersResponseSchema = z.object({
id: z.number(),
uuid: z.string(),
user: z.object({
uuid: z.string(),
name: z.string(),
role: z.enum(['ADMINISTRATOR', 'STANDARD_USER']),
}),
timestamp: z.string().datetime(),
form_id: z.number(),
title: z.string(),
Expand All @@ -99,7 +103,11 @@ export type GetAnswersResponse = z.infer<typeof getAnswersResponseSchema>;
// GET /forms/answers/:answerId
export const getAnswerResponseSchema = z.object({
id: z.number(),
uuid: z.string(),
user: z.object({
uuid: z.string(),
name: z.string(),
role: z.enum(['ADMINISTRATOR', 'STANDARD_USER']),
}),
timestamp: z.string().datetime(),
form_id: z.number(),
title: z.string(),
Expand Down

0 comments on commit 6c35634

Please sign in to comment.