Skip to content

Commit

Permalink
feat: (#24) post 관련 type 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
chsua committed Jul 14, 2023
1 parent d3ffc40 commit b3e751a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import React from 'react';
import { WrittenVoteOptionType } from '@type/post';

import * as S from './style';
import WrittenVoteOption from './WrittenVoteOption';

interface WrittenVoteOptionType {
id: number;
text: string;
peopleCount: number;
percent: number;
imageUrl?: string;
}

interface WrittenVoteOptionListProps {
isPreview: boolean;
selectedOptionId: number;
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/types/post.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export interface WrittenVoteOptionType {
id: number;
text: string;
peopleCount: number;
percent: number;
imageUrl?: string;
}

export interface PostInfo {
postId: number;
title: string;
writer: { id: number; nick: string };
content: string;
category: { id: number; name: string }[];
startTime: string;
endTime: string;
voteInfo: {
selectedOptionId: number;
allPeopleCount: number;
options: WrittenVoteOptionType[];
};
}

0 comments on commit b3e751a

Please sign in to comment.