Skip to content

Commit

Permalink
refactor: (#741) StringDateOnly Type 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilpop8663 committed Oct 18, 2023
1 parent 60464df commit fd69f50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions frontend/src/api/notice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
NoticeRequest,
NoticeResponse,
} from '@type/notice';
import { StringDateOnly } from '@type/time';
import { StringDateUpToDay } from '@type/time';

import { deleteFetch, getFetch, patchFetch, postFetch } from '@utils/fetch';

Expand All @@ -22,7 +22,7 @@ export const transformNotice = ({
id,
title,
content,
createdAt: createdAt.split(' ')[0] as StringDateOnly,
createdAt: createdAt.split(' ')[0] as StringDateUpToDay,
deadline,
bannerTitle,
bannerSubtitle,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/types/notice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StringDate, StringDateOnly } from './time';
import { StringDate, StringDateUpToDay } from './time';

export interface NoticeResponse {
id: number;
Expand All @@ -18,6 +18,6 @@ export interface NoticeListResponse {

export type NoticeRequest = Omit<Notice, 'createdAt' | 'id'>;

export type Notice = Omit<NoticeResponse, 'createdAt'> & { createdAt: StringDateOnly };
export type Notice = Omit<NoticeResponse, 'createdAt'> & { createdAt: StringDateUpToDay };

export type NoticeList = Omit<NoticeListResponse, 'notices'> & { noticeList: Notice[] };
2 changes: 1 addition & 1 deletion frontend/src/types/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export type StringDate = `${number}-${number}-${number} ${number}:${number}`;
/**
* yyyy-mm-dd
*/
export type StringDateOnly = `${number}-${number}-${number}`;
export type StringDateUpToDay = `${number}-${number}-${number}`;

0 comments on commit fd69f50

Please sign in to comment.