diff --git a/.env b/.env index 3206c940..b6c91bcc 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -NEXT_PUBLIC_API_BASE_URL=https://api.stg.ziggle.gistory.me/ -NEXT_PUBLIC_IDP_BASE_URL=https://idp.gistory.me/ +NEXT_PUBLIC_API_BASE_URL=https://api.stg.ziggle.gistory.me/v3/ +NEXT_PUBLIC_IDP_BASE_URL=https://stg.idp.gistory.me/ NEXT_PUBLIC_IDP_CLIENT_ID=ziggle2023 NEXT_PUBLIC_IDP_REDIRECT_URI=https://stg.ziggle.gistory.me/api/login diff --git a/src/api/notice/get-notice.ts b/src/api/notice/get-notice.ts new file mode 100644 index 00000000..4605179e --- /dev/null +++ b/src/api/notice/get-notice.ts @@ -0,0 +1,18 @@ +import { cookies } from 'next/headers'; + +import api from '..'; +import { NoticeDetail } from './notice'; + +export const getNotice = async (id: number) => { + return api + .get(`/notice/${id}`, { + headers: { + Authorization: `Bearer ${cookies().get('access_token')?.value}`, + }, + }) + .then(({ data }) => ({ + ...data, + deadline: data.deadline || null, + currentDeadline: data.currentDeadline || null, + })); +}; diff --git a/src/api/notice/notice.ts b/src/api/notice/notice.ts index 70c09c2c..a1c6d222 100644 --- a/src/api/notice/notice.ts +++ b/src/api/notice/notice.ts @@ -1,4 +1,5 @@ import dayjs from 'dayjs'; +import { cookies } from 'next/headers'; import { gql } from '@/generated'; @@ -9,6 +10,11 @@ export interface NoticePaginationParams { limit?: number; } +export interface Tag { + id: number; + name: string; +} + export enum NoticeKind { RECRUIT = 'recruit', EVENT = 'event', @@ -25,46 +31,40 @@ export interface NoticeSearchParams { export interface Notice { id: number; - views: number; - currentDeadline?: dayjs.Dayjs | string | null; - createdAt: dayjs.Dayjs | string; - updatedAt: dayjs.Dayjs | string; - deletedAt?: dayjs.Dayjs | string | null; - author: string; - tags: Tag[]; - logName?: string; - contents: Content[]; - imagesUrl: string[]; - files?: NoticeFile[] | null; -} - -export interface Content { - id: number; - lang: string; // TODO: enum graphql과의 호환성 문제로 임시로 string으로 사용 title: string; - body: string; - deadline?: dayjs.Dayjs | string | null; + deadline: dayjs.Dayjs | string | null; + currentDeadline: dayjs.Dayjs | string | null; + langs: string[]; + content: string; + author: { + name: string; + uuid: string; + }; createdAt: dayjs.Dayjs | string; - noticeId: number; + tags: string[]; + views: number; + imageUrls: string[]; + documentUrls: string[]; + isReminded: boolean; + reactions: Reaction[]; } -interface NoticeFile { - uuid: string; - name: string; - createdAt: dayjs.Dayjs | string; - url: string; - type: string; // TODO: enum - noticeId: number; +export interface Reaction { + emoji: string; + count: number; + isReacted: boolean; } -export interface Tag { +export interface Content { id: number; - name: string; + deadline: Date | null; + content: string; + lang: string; + createdAt: Date; } export interface NoticeDetail extends Notice { - reminder: boolean; - authorId: string; + additionalContents: Content[]; } export interface Notices { @@ -72,55 +72,30 @@ export interface Notices { total: number; } -export const getAllNotices = async ( - params: NoticePaginationParams & NoticeSearchParams = {}, -) => - api.get('/notice', { params }).then(({ data }) => ({ - ...data, - list: data.list.map(({ currentDeadline, ...notice }) => ({ - ...notice, - currentDeadline: currentDeadline ?? null, - contents: notice.contents.map(({ deadline, ...content }) => ({ - ...content, - deadline: deadline ?? null, - })), - })), - })); - -export const getNotice = async (id: number) => - api.get(`/notice/${id}`).then(({ data }) => ({ - ...data, - currentDeadline: data.currentDeadline || null, - contents: data.contents.map(({ deadline, ...content }) => ({ - ...content, - deadline: deadline || null, - })), - })); - export const GET_NOTICES = gql(` query GetNotices($offset: Int, $limit: Int) { notices(offset: $offset, limit: $limit, orderBy: RECENT) { list { id - views + title + deadline currentDeadline - createdAt - updatedAt - deletedAt - author - imagesUrl - tags { - id + langs + content + author { name + uuid } - contents { - id - lang - title - body - deadline - createdAt - noticeId + createdAt + tags + views + imageUrls + documentUrls + isReminded + reactions { + emoji + count + isReacted } } total @@ -132,14 +107,12 @@ export const CREATE_NOTICE = gql(` mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) { createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) { id - contents { + additionalContents { id - lang - title - body deadline + content + lang createdAt - noticeId } } } @@ -149,14 +122,6 @@ export const ATTACH_INTERNATIONAL_NOTICE = gql(` mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) { attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) { id - contents { - id - lang - title - body - deadline - createdAt - } } } `); @@ -165,14 +130,12 @@ export const CREATE_ADDITIONAL_NOTICE = gql(` mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) { createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) { id - contents { + additionalContents { id - lang - title - body deadline + content + lang createdAt - noticeId } } } @@ -183,3 +146,59 @@ export const DELETE_NOTICE = gql(` deleteNotice(id: $id) } `); + +export const ADD_REACTION = gql(` + mutation AddReaction($noticeId: Int!, $emoji: String!) { + addReaction(noticeId: $noticeId, emoji: $emoji) { + id + title + deadline + currentDeadline + langs + content + author { + name + uuid + } + createdAt + tags + views + imageUrls + documentUrls + isReminded + reactions { + emoji + count + isReacted + } + } + } +`); + +export const DELETE_REACTION = gql(` + mutation DeleteReaction($noticeId: Int!, $emoji: String!) { + deleteReaction(noticeId: $noticeId, emoji: $emoji) { + id + title + deadline + currentDeadline + langs + content + author { + name + uuid + } + createdAt + tags + views + imageUrls + documentUrls + isReminded + reactions { + emoji + count + isReacted + } + } + } +`); diff --git a/src/app/[lng]/(common)/mypage/MypageTable.tsx b/src/app/[lng]/(common)/mypage/MypageTable.tsx index 7da5cd81..f88d94b3 100644 --- a/src/app/[lng]/(common)/mypage/MypageTable.tsx +++ b/src/app/[lng]/(common)/mypage/MypageTable.tsx @@ -5,7 +5,6 @@ import { Notice } from '@/api/notice/notice'; import { createTranslation, PropsWithLng } from '@/app/i18next'; import { Locale } from '@/app/i18next/settings'; import LazyCat from '@/assets/lazy-cat.svg'; -import getLocaleContents from '@/utils/getLocaleContents'; interface MypageTableProps { title: string; @@ -49,7 +48,6 @@ const MypageTable = async ({ {articles.map((articleObj, index) => { const isLastRow = index === articles.length - 1; const underLine = isLastRow ? '' : 'border-b border-gray-300'; - const localeContents = getLocaleContents(articleObj.contents, lng); return (
- {localeContents[0].title} + {articleObj.title}
diff --git a/src/app/[lng]/(common)/notice/[id]/AddAdditionalNotice.tsx b/src/app/[lng]/(common)/notice/[id]/AddAdditionalNotice.tsx index 015ae2b5..967470ec 100644 --- a/src/app/[lng]/(common)/notice/[id]/AddAdditionalNotice.tsx +++ b/src/app/[lng]/(common)/notice/[id]/AddAdditionalNotice.tsx @@ -24,17 +24,16 @@ import AddIcon from '@/assets/icons/add.svg'; import { WarningSwal } from '@/utils/swals'; import { apolloClient } from '../../InitClient'; -import AddNoticeRadio from './AddNoticeRadio'; interface AddAddtionalNoticesProps { noticeId: number; originallyHasDeadline: string | Dayjs | null; - supportLanguage: string[]; + supportedLanguage: string[]; } const AddAdditionalNotice = ({ noticeId, - supportLanguage, + supportedLanguage, originallyHasDeadline, lng, }: AddAddtionalNoticesProps & PropsWithLng) => { @@ -46,7 +45,7 @@ const AddAdditionalNotice = ({ const { t } = useTranslation(lng); - const supportEnglish = supportLanguage.includes('en'); + const supportEnglish = supportedLanguage.includes('en'); const { refresh } = useRouter(); @@ -72,7 +71,7 @@ const AddAdditionalNotice = ({ }, }); - const contents = notice.data?.createAdditionalNotice.contents; + const contents = notice.data?.createAdditionalNotice.additionalContents; if (!contents) { return; } @@ -156,7 +155,7 @@ const AddAdditionalNotice = ({ />
- {supportLanguage.includes('en') && ( + {supportedLanguage.includes('en') && (
{t('zabo.additionalNotices.englishAdditionalNotice')} diff --git a/src/app/[lng]/(common)/notice/[id]/AdditionalNotices.tsx b/src/app/[lng]/(common)/notice/[id]/AdditionalNotices.tsx index cd10a8e9..f700c740 100644 --- a/src/app/[lng]/(common)/notice/[id]/AdditionalNotices.tsx +++ b/src/app/[lng]/(common)/notice/[id]/AdditionalNotices.tsx @@ -1,18 +1,17 @@ import dayjs from 'dayjs'; -import { Content } from '@/api/notice/notice'; +import { Content, NoticeDetail } from '@/api/notice/notice'; import { PropsWithLng, T } from '@/app/i18next'; import AddIcon from '@/assets/icons/add.svg'; -import getLocaleContents from '@/utils/getLocaleContents'; interface AdditionalNoticesProps { - mainContent: Content; + notice: NoticeDetail; additionalContents: Content[]; t: T; } const AdditionalNotices = async ({ - mainContent, + notice, additionalContents, t, lng, @@ -21,13 +20,11 @@ const AdditionalNotices = async ({
{additionalContents.map((content, index) => { const lastDeadline = - index > 0 - ? additionalContents[index - 1].deadline - : mainContent.deadline; + index > 0 ? additionalContents[index - 1].deadline : notice.deadline; - const deadlineChanged = !dayjs(content.deadline).isSame( - dayjs(lastDeadline), - ); + const deadlineChanged = + content.deadline && + !dayjs(content.deadline).isSame(dayjs(lastDeadline)); return (
-

{content.body}

+

{content.content}

); diff --git a/src/app/[lng]/(common)/notice/[id]/NoticeInfo.tsx b/src/app/[lng]/(common)/notice/[id]/NoticeInfo.tsx index 1b3e5c4e..df65fc10 100644 --- a/src/app/[lng]/(common)/notice/[id]/NoticeInfo.tsx +++ b/src/app/[lng]/(common)/notice/[id]/NoticeInfo.tsx @@ -7,13 +7,13 @@ import { NoticeDetail } from '@/api/notice/notice'; import DDay from '@/app/components/molecules/DDay'; import Tags from '@/app/components/organisms/Tags'; import { createTranslation, PropsWithLng, PropsWithT } from '@/app/i18next'; -import getLocaleContents from '@/utils/getLocaleContents'; interface NoticeInfoProps extends Omit {} const NoticeInfo = async ({ currentDeadline: deadline, - contents, + title, + content, author, createdAt, views, @@ -21,7 +21,6 @@ const NoticeInfo = async ({ lng, }: PropsWithLng) => { const { t } = await createTranslation(lng); - const localeContents = getLocaleContents(contents, lng); return (
@@ -31,10 +30,10 @@ const NoticeInfo = async ({
)} - + <Title title={title} /> <div className="h-2" /> <Metadata - author={author} + author={author.name} createdAt={dayjs(createdAt)} views={views} t={t} diff --git a/src/app/[lng]/(common)/notice/[id]/Reactions.tsx b/src/app/[lng]/(common)/notice/[id]/Reactions.tsx new file mode 100644 index 00000000..346e0891 --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/Reactions.tsx @@ -0,0 +1,120 @@ +'use client'; + +import { FetchResult } from '@apollo/client'; +import { useState } from 'react'; +import { toast } from 'react-toastify'; + +import { + ADD_REACTION, + DELETE_REACTION, + Notice, + Reaction, +} from '@/api/notice/notice'; +import Button from '@/app/components/atoms/Button'; +import { + AddReactionMutation, + DeleteReactionMutation, +} from '@/generated/graphql'; + +import { apolloClient } from '../../InitClient'; +import AnguishedFace from './assets/anguished-face.svg'; +import Fire from './assets/fire-outlined.svg'; +import LoudlyCryingFace from './assets/loudly-crying-face.svg'; +import SurprisedFace from './assets/surprised-face-with-open-mouth.svg'; +import ThinkingFace from './assets/thinking-face.svg'; + + +const emojis = { + '🔥': <Fire width={20} fill={'#eb6263'} />, + '😭': <LoudlyCryingFace width={20} />, + '😧': <AnguishedFace width={20} />, + '🤔': <ThinkingFace width={20} />, + '😮': <SurprisedFace width={20} />, +}; + +const ReactionButton = ({ + emoji, + count, + isReacted, + onClick, +}: Reaction & { onClick: () => void }) => { + return ( + <Button variant={isReacted ? 'contained' : 'outlined'} onClick={onClick}> + {emojis[emoji as keyof typeof emojis] ?? <p>{emoji}</p>} + + <p>{count}</p> + </Button> + ); +}; + +interface ReactionsProps { + notice: Notice; +} + +const Reactions = ({ notice: { id, reactions } }: ReactionsProps) => { + const [currentReactions, setCurrentReactions] = + useState<Reaction[]>(reactions); + + const toggleReaction = async (emoji: string, isReacted: boolean) => { + try { + if (isReacted) { + const res = await apolloClient.mutate({ + mutation: DELETE_REACTION, + variables: { + noticeId: id, + emoji, + }, + }); + + return res.data?.deleteReaction.reactions; + } else { + const res = await apolloClient.mutate({ + mutation: ADD_REACTION, + variables: { + noticeId: id, + emoji, + }, + }); + + return res.data?.addReaction.reactions; + } + } catch (e) { + toast.error('로그인이 필요합니다.'); + } + }; + + const handleEmojiClick = async (emoji: string, isReacted: boolean) => { + const reactions = await toggleReaction(emoji, isReacted); + + if (reactions) { + setCurrentReactions(reactions); + } + }; + + return ( + <div className={'flex gap-2'}> + {Object.keys(emojis) + .map((emoji) => { + const reaction = currentReactions.find( + (reaction) => reaction.emoji === emoji, + ); + + return { + emoji, + count: reaction?.count ?? 0, + isReacted: reaction?.isReacted ?? false, + }; + }) + .map((reaction) => ( + <ReactionButton + key={reaction.emoji} + onClick={() => handleEmojiClick(reaction.emoji, reaction.isReacted)} + {...reaction} + isReacted={reaction.isReacted} + /> + ))} + </div> + ); +}; + +export default Reactions; diff --git a/src/app/[lng]/(common)/notice/[id]/assets/anguished-face.svg b/src/app/[lng]/(common)/notice/[id]/assets/anguished-face.svg new file mode 100644 index 00000000..42fc85a7 --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/assets/anguished-face.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><g><circle cx="20" cy="20" r="17.5" fill="#ffc84d"/><circle cx="15.422" cy="17.007" r="2.114"/><circle cx="24.578" cy="17.007" r="2.114"/><path d="m15.715,29.294c-.788,0-1.403-.75-1.194-1.51.661-2.405,2.864-4.172,5.479-4.172,2.615,0,4.818,1.767,5.479,4.172.209.76-.406,1.51-1.194,1.51h-8.571Z" fill="#ff6d00"/><path d="m13.185,10.222c-1.182.43-1.766.95-2.254,1.416-.281.269-.633.103-.593-.311.085-.895.745-2.063,2.293-2.627,1.549-.564,2.805-.093,3.445.538.296.292.134.645-.255.62-.674-.044-1.455-.067-2.637.364Z"/><path d="m26.815,10.222c1.182.43,1.766.95,2.254,1.416.281.269.633.103.593-.311-.085-.895-.745-2.063-2.293-2.627-1.549-.564-2.805-.093-3.445.538-.296.292-.134.645.255.62.674-.044,1.455-.067,2.637.364Z"/></g><rect width="40" height="40" fill="none"/></svg> \ No newline at end of file diff --git a/src/app/[lng]/(common)/notice/[id]/assets/fire-outlined.svg b/src/app/[lng]/(common)/notice/[id]/assets/fire-outlined.svg new file mode 100644 index 00000000..0637f2f9 --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/assets/fire-outlined.svg @@ -0,0 +1,4 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="20" height="21" viewBox="0 0 20 21" fill="none"> + <path d="M9.99998 18C14.2079 18 16.6666 15.5796 16.6666 11.4375C16.6666 7.29536 9.99998 3 9.99998 3C9.99998 3 3.33331 7.29536 3.33331 11.4375C3.33331 15.5796 5.7921 18 9.99998 18Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/> + <path d="M6.66669 15.5C6.66669 17.5123 8.15907 18 10 18C13.1323 18 14.1667 15.9167 12.0834 11.75C9.16669 15.5 8.75002 9.66667 9.16669 8C7.91669 10.5 6.66669 12.8481 6.66669 15.5Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/> +</svg> \ No newline at end of file diff --git a/src/app/[lng]/(common)/notice/[id]/assets/loudly-crying-face.svg b/src/app/[lng]/(common)/notice/[id]/assets/loudly-crying-face.svg new file mode 100644 index 00000000..e578ba59 --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/assets/loudly-crying-face.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="17.5" fill="#ffc84d"/><path d="m13.218,13.571c-1.14.532-1.676,1.1-2.122,1.607-.257.292-.621.158-.618-.258.007-.899.562-2.12,2.056-2.817,1.494-.696,2.786-.337,3.479.236.321.265.19.631-.2.64-.675.015-1.455.061-2.595.592Z"/><path d="m26.782,13.571c1.14.532,1.676,1.1,2.122,1.607.257.292.621.158.618-.258-.007-.899-.562-2.12-2.056-2.817-1.494-.696-2.786-.337-3.479.236-.321.265-.19.631.2.64.675.015,1.455.061,2.595.592Z"/><circle cx="20" cy="28.933" r="2.5" fill="#ff6d00"/><g><path d="m23.074,19.649l2.657,15.808c1.58-.586,3.044-1.403,4.353-2.417l-2.251-13.391h-4.76Z" fill="#fff"/><path d="m12.166,19.649l-2.251,13.391c1.309,1.014,2.773,1.83,4.353,2.417l2.657-15.808h-4.76Z" fill="#fff"/></g><path d="m28.279,20.099c.262.091.563-.069.505-.271-.323-1.124-1.691-1.967-3.33-1.967-1.639,0-3.007.844-3.33,1.967-.058.202.243.362.505.271.571-.199,1.546-.451,2.825-.451,1.279,0,2.254.251,2.825.451Z"/><path d="m11.721,20.099c-.262.091-.563-.069-.505-.271.323-1.124,1.691-1.967,3.33-1.967s3.007.844,3.33,1.967c.058.202-.243.362-.505.271-.571-.199-1.546-.451-2.825-.451s-2.254.251-2.825.451Z"/><rect width="40" height="40" fill="none"/></svg> \ No newline at end of file diff --git a/src/app/[lng]/(common)/notice/[id]/assets/surprised-face-with-open-mouth.svg b/src/app/[lng]/(common)/notice/[id]/assets/surprised-face-with-open-mouth.svg new file mode 100644 index 00000000..6a233f8d --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/assets/surprised-face-with-open-mouth.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><g><circle cx="20" cy="20" r="17.5" fill="#ffc84d"/><circle cx="20" cy="26.12" r="3.6" fill="#ff6d00"/><g><circle cx="15.422" cy="17.007" r="2.114"/><circle cx="24.578" cy="17.007" r="2.114"/></g></g><rect width="40" height="40" fill="none"/></svg> \ No newline at end of file diff --git a/src/app/[lng]/(common)/notice/[id]/assets/thinking-face.svg b/src/app/[lng]/(common)/notice/[id]/assets/thinking-face.svg new file mode 100644 index 00000000..7cc0b54e --- /dev/null +++ b/src/app/[lng]/(common)/notice/[id]/assets/thinking-face.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><g><ellipse cx="20" cy="19.968" rx="17.5" ry="17.448" fill="#ffc84d"/><path d="m18.483,24.231c1.453.127,2.532.497,3.214.809.293.134.582-.191.417-.467-.534-.888-1.595-2.103-3.462-2.265s-3.124.849-3.804,1.632c-.211.243.017.613.329.532.727-.189,1.854-.367,3.306-.24Z" fill="#ff6d00"/><path d="m13.927,10.834c1.194.104,1.859.437,2.423.746.325.178.608-.061.47-.431-.299-.8-1.194-1.71-2.758-1.847-1.564-.136-2.605.605-3.038,1.341-.201.341.036.625.387.506.609-.206,1.323-.419,2.516-.315Z"/><path d="m24.17,7.756c-1.194.104-1.859.437-2.423.746-.325.178-.608-.061-.47-.431.299-.8,1.194-1.71,2.758-1.847,1.564-.136,2.605.605,3.038,1.341.201.341-.036.625-.387.506-.609-.206-1.323-.419-2.516-.315Z"/><ellipse cx="14.34" cy="15.204" rx="2.229" ry="2.222"/><ellipse cx="23.621" cy="14.84" rx="2.191" ry="2.587"/><path d="m7.976,32.415c0-1.757.16-3.865.24-5.035.061-.89.123-2.529.236-3.273.116-.767.559-1.416,1.407-1.129.81.275,1.217,1.458,1.217,2.477s.076,1.699.685,2.009,1.363.268,2.577.268,5.436-.085,7.581-.085c.495,0,1.26.071,1.611.419.437.434.349,1.276-.302,1.564-1.045.462-3.505.356-4.157.64s-.601.749-.64,1.458c-.047.87.158,3.14-.047,4.088-.232,1.075-.868,1.667-1.823,1.667h-4.109c-2.455,0-4.475-2.423-4.475-5.068Z" fill="#ff9210"/></g><rect width="40" height="40" fill="none"/></svg> \ No newline at end of file diff --git a/src/app/[lng]/(common)/notice/[id]/page.tsx b/src/app/[lng]/(common)/notice/[id]/page.tsx index 01b266af..d070881d 100644 --- a/src/app/[lng]/(common)/notice/[id]/page.tsx +++ b/src/app/[lng]/(common)/notice/[id]/page.tsx @@ -1,15 +1,12 @@ -import { GetServerSideProps, Metadata, ResolvingMetadata } from 'next'; -import { useRouter } from 'next/router'; -import { createServerContext } from 'react'; +import { Metadata, ResolvingMetadata } from 'next'; import { auth } from '@/api/auth/auth'; -import { getNotice } from '@/api/notice/notice'; +import { getNotice } from '@/api/notice/get-notice'; import ImageCarousel from '@/app/components/organisms/ImageCarousel'; import HowAboutThese from '@/app/components/templates/HowAboutThese'; import ZaboShowcase from '@/app/components/templates/ZaboShowcase'; -import { createTranslation, PropsWithLng } from '@/app/i18next'; +import { createTranslation } from '@/app/i18next'; import { Locale } from '@/app/i18next/settings'; -import getLocaleContents from '@/utils/getLocaleContents'; import Actions from './Actions'; import AddAdditionalNotice from './AddAdditionalNotice'; @@ -17,6 +14,7 @@ import AddtionalNotices from './AdditionalNotices'; import AuthorActions from './AuthorActions'; import Content from './Content'; import NoticeInfo from './NoticeInfo'; +import Reactions from './Reactions'; import WriteEnglishNotice from './WriteEnglishNotice'; export const generateMetadata = async ( @@ -29,18 +27,16 @@ export const generateMetadata = async ( const notice = await getNotice(Number.parseInt(id)); const previousImages = (await parent).openGraph?.images ?? []; - const localeContents = getLocaleContents(notice.contents, searchParams.lng); - return { - title: localeContents[0].title, - description: localeContents[0].body.slice(0, 100).replace(/\n/g, ' '), - keywords: notice.tags.map((tag) => tag.name), - authors: [{ name: notice.author }], + title: notice.title, + description: notice.content.slice(0, 100).replace(/\n/g, ' '), + keywords: notice.tags, + authors: [{ name: notice.author.name }], openGraph: { - title: localeContents[0].title, - description: localeContents[0].body.slice(0, 100).replace(/\n/g, ' '), + title: notice.title, + description: notice.content.slice(0, 100).replace(/\n/g, ' '), url: `https://ziggle.gistory.me/notice/${id}`, - images: [...notice.imagesUrl, ...previousImages], + images: [...notice.imageUrls, ...previousImages], }, }; }; @@ -55,32 +51,22 @@ const DetailedNoticePage = async ({ const { t } = await createTranslation(lng, 'translation'); const notice = await getNotice(Number.parseInt(id)); - const localContents = getLocaleContents(notice.contents, lng); - - const mainContent = - localContents.find((content) => content.id === 1) ?? localContents[0]; - - const additionalContents = localContents.filter( - (content) => content.id !== 1, - ); - - const title = localContents[0].title; + const title = notice.title; const user = await auth(); const isAdditionalNoticeShow = true; const isWriteEnglishNoticeShow = true; - const supportLanguage = notice.contents.map((content) => content.lang); // TODO: make this unique - const supportEnglish = supportLanguage.includes('en'); + const supportEnglish = notice.langs.includes('en'); return ( <> - <ZaboShowcase srcs={notice.imagesUrl} alt={title} lng={lng} /> + <ZaboShowcase srcs={notice.imageUrls} alt={title} lng={lng} /> <div className="content mx-auto mt-8 md:mt-12"> - <Actions title={localContents[0].title} lng={lng} /> + <Actions title={title} lng={lng} /> - {user && user.id === notice.authorId && ( + {user && user.id === notice.author.uuid && ( <> <div className="h-5" /> <AuthorActions @@ -99,30 +85,30 @@ const DetailedNoticePage = async ({ lng={lng} /> <div className="h-5" /> - <Content content={mainContent?.body ?? ''} /> + <Content content={notice.content} /> <div className="h-10" /> <AddtionalNotices - additionalContents={additionalContents} - mainContent={mainContent} + additionalContents={notice.additionalContents} + notice={notice} t={t} lng={lng} /> - {user && user.id === notice.authorId && isAdditionalNoticeShow && ( + {user && user.id === notice.author.uuid && isAdditionalNoticeShow && ( <> <div className="h-10" id="addNotice" /> <AddAdditionalNotice lng={lng} noticeId={Number(id)} - originallyHasDeadline={notice.currentDeadline} - supportLanguage={supportLanguage} + originallyHasDeadline={notice.deadline} + supportedLanguage={notice.langs} /> </> )} {user && - user.id === notice.authorId && + user.id === notice.author.uuid && isWriteEnglishNoticeShow && !supportEnglish && ( <> @@ -135,10 +121,14 @@ const DetailedNoticePage = async ({ </> )} - {notice.imagesUrl.length > 0 && ( + <div className={'mt-6 flex justify-center'}> + <Reactions notice={notice} /> + </div> + + {notice.imageUrls.length > 0 && ( <> <div className="h-20" /> - <ImageCarousel srcs={notice.imagesUrl} alt={title} lng={lng} /> + <ImageCarousel srcs={notice.imageUrls} alt={title} lng={lng} /> </> )} <div className="h-20" /> diff --git a/src/app/[lng]/(common)/write/handle-notice-submit.ts b/src/app/[lng]/(common)/write/handle-notice-submit.ts index 5b9771d5..777abe8d 100644 --- a/src/app/[lng]/(common)/write/handle-notice-submit.ts +++ b/src/app/[lng]/(common)/write/handle-notice-submit.ts @@ -206,7 +206,7 @@ const handleNoticeSubmit = async ({ return; } - const { id, contents } = notice.data?.createNotice; + const { id, additionalContents } = notice.data?.createNotice; if (!id) { Swal.fire({ @@ -226,7 +226,7 @@ const handleNoticeSubmit = async ({ deadline, body: englishBody!, noticeId: id, - contentId: contents[0].id, + contentId: additionalContents[0].id, }, }); } diff --git a/src/app/api/graphql/notices-api.ts b/src/app/api/graphql/notices-api.ts index 6f0133bd..c4278fcb 100644 --- a/src/app/api/graphql/notices-api.ts +++ b/src/app/api/graphql/notices-api.ts @@ -15,7 +15,7 @@ export default class NoticesAPI extends RESTDataSource { offset, limit, tags = [], - ...params + ...params // attach auth token if needed }: NoticeSearchParams & NoticePaginationParams = {}) { return this.get<Notices>('notice', { params: { @@ -27,8 +27,10 @@ export default class NoticesAPI extends RESTDataSource { }); } - async getNotice(id: number) { - return this.get<NoticeDetail>(`notice/${id}`); + async getNotice(data: { id: number }, token: string) { + return this.get<NoticeDetail>(`notice/${data.id}`, { + headers: { Authorization: `Bearer ${token}` }, + }); } async createNotice( @@ -93,4 +95,18 @@ export default class NoticesAPI extends RESTDataSource { return false; } } + + async addReaction(noticeId: number, emoji: string, token: string) { + return this.post(`notice/${noticeId}/reaction`, { + body: { emoji }, + headers: { Authorization: `Bearer ${token}` }, + }); + } + + async deleteReaction(noticeId: number, emoji: string, token: string) { + return this.delete(`notice/${noticeId}/reaction`, { + body: { emoji }, + headers: { Authorization: `Bearer ${token}` }, + }); + } } diff --git a/src/app/api/graphql/route.ts b/src/app/api/graphql/route.ts index 07152a72..3ed37ce9 100644 --- a/src/app/api/graphql/route.ts +++ b/src/app/api/graphql/route.ts @@ -32,8 +32,8 @@ const resolvers: Resolvers = { search: search ?? undefined, tags: tags ?? undefined, }), - notice: (_, { id }, { dataSources }) => - dataSources.noticesAPI.getNotice(id), + notice: (_, { id }, { dataSources, accessToken }) => + dataSources.noticesAPI.getNotice({ id }, accessToken!), }, Mutation: { createNotice: ( @@ -65,6 +65,10 @@ const resolvers: Resolvers = { ), deleteNotice: (_, { id }, { dataSources, accessToken }) => dataSources.noticesAPI.deleteNotice(id, accessToken!), + addReaction: (_, { noticeId, emoji }, { dataSources, accessToken }) => + dataSources.noticesAPI.addReaction(noticeId, emoji, accessToken!), + deleteReaction: (_, { noticeId, emoji }, { dataSources, accessToken }) => + dataSources.noticesAPI.deleteReaction(noticeId, emoji, accessToken!), }, }; diff --git a/src/app/api/graphql/schema.graphql b/src/app/api/graphql/schema.graphql index 60c93563..f20d6f34 100644 --- a/src/app/api/graphql/schema.graphql +++ b/src/app/api/graphql/schema.graphql @@ -1,57 +1,57 @@ scalar Date -type Tag { - id: Int! - name: String! -} - type Content { id: Int! - lang: String! - title: String! - body: String! deadline: Date + content: String! + lang: String! createdAt: Date! - noticeId: Int! } -type NoticeFile { - uuid: String! +type Reaction { + emoji: String! + count: Int! + isReacted: Boolean! +} + +type Author { name: String! - createdAt: Date! - url: String! - type: String! - noticeId: Int! + uuid: String! } type Notice { id: Int! - views: Int! + title: String! + deadline: Date currentDeadline: Date + langs: [String!]! + content: String! + author: Author! createdAt: Date! - updatedAt: Date! - deletedAt: Date - author: String! - tags: [Tag!]! - imagesUrl: [String!]! - contents: [Content!]! - files: [NoticeFile!] + tags: [String!]! + views: Int! + imageUrls: [String!]! + documentUrls: [String!]! + isReminded: Boolean! + reactions: [Reaction!]! } type DetailedNotice { id: Int! - views: Int! + title: String! + deadline: Date currentDeadline: Date + langs: [String!]! + content: String! + author: Author! createdAt: Date! - updatedAt: Date! - deletedAt: Date - authorId: String! - author: String! - tags: [Tag!]! - imagesUrl: [String!]! - contents: [Content!]! - files: [NoticeFile!] - reminder: Boolean! + tags: [String!]! + views: Int! + imageUrls: [String!]! + documentUrls: [String!]! + isReminded: Boolean! + reactions: [Reaction!]! + additionalContents: [Content!]! } type Notices { @@ -98,4 +98,6 @@ type Mutation { noticeId: Int! ): DetailedNotice! deleteNotice(id: Int!): Boolean! + addReaction(noticeId: Int!, emoji: String!): DetailedNotice! + deleteReaction(noticeId: Int!, emoji: String!): DetailedNotice! } diff --git a/src/app/components/organisms/Tags/Tags.tsx b/src/app/components/organisms/Tags/Tags.tsx index 3abe7551..07967349 100644 --- a/src/app/components/organisms/Tags/Tags.tsx +++ b/src/app/components/organisms/Tags/Tags.tsx @@ -1,4 +1,3 @@ -import { Tag } from '@/api/notice/notice'; import { createTranslation, PropsWithLng } from '@/app/i18next'; import Chip from '../../molecules/Chip'; @@ -14,16 +13,16 @@ const Tags = async ({ searchQuery, lng, }: PropsWithLng<{ - tags: Tag[]; + tags: string[]; className?: string; searchQuery?: string; }>) => { const { t } = await createTranslation(lng); return ( <div className={`flex gap-2 ${className ?? ''}`}> - {tags.map(({ id, name }, i) => ( + {tags.map((name, i) => ( <Chip - key={id} + key={name} className="font-normal" variant={name === searchQuery ? 'contained' : undefined} >{`#${isDefaultTag(name) ? t(`notices.${name}.name`) : name}`}</Chip> diff --git a/src/app/components/organisms/Zabo/ImageZabo.stories.tsx b/src/app/components/organisms/Zabo/ImageZabo.stories.tsx index 7ef195a3..375c50da 100644 --- a/src/app/components/organisms/Zabo/ImageZabo.stories.tsx +++ b/src/app/components/organisms/Zabo/ImageZabo.stories.tsx @@ -16,12 +16,12 @@ const Template: StoryFn<typeof Zabo> = (args) => { return <Zabo {...args} t={t} />; }; const args = { - imagesUrl: ['https://picsum.photos/200/300'], + imageUrls: ['https://picsum.photos/200/300'], title: '23년도 인포팀 신규 부원 모집', content: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', createdAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, - author: '이정우', + author: { name: '인포팀', uuid: 'info' }, deadline: dayjs().add(1, 'd'), }; diff --git a/src/app/components/organisms/Zabo/ImageZabo.tsx b/src/app/components/organisms/Zabo/ImageZabo.tsx index 78e9d225..273e7e47 100644 --- a/src/app/components/organisms/Zabo/ImageZabo.tsx +++ b/src/app/components/organisms/Zabo/ImageZabo.tsx @@ -3,14 +3,13 @@ import { Trans } from 'react-i18next'; import ZaboImage from '@/app/components/molecules/ZaboImage'; import { PropsWithLng } from '@/app/i18next'; -import getLocaleContents from '@/utils/getLocaleContents'; import DDay from '../../molecules/DDay'; import { ZaboOrigin, ZaboProps, ZaboSize } from './Zabo'; const ImageZabo = <Origin extends ZaboOrigin>({ - imagesUrl, - contents, + imageUrls, + title, createdAt, views, author, @@ -20,13 +19,9 @@ const ImageZabo = <Origin extends ZaboOrigin>({ height, lng, }: ZaboProps<Origin> & PropsWithLng) => { - const localContents = getLocaleContents(contents, lng); - const deadline = rawDeadline ? dayjs(rawDeadline) : undefined; const size = { width, height } as ZaboSize<Origin>; - const title = localContents[0].title; - return ( <div className="group mt-4 flex w-min flex-col gap-3"> <div @@ -37,7 +32,7 @@ const ImageZabo = <Origin extends ZaboOrigin>({ } > <ZaboImage - src={imagesUrl[0]} + src={imageUrls[0]} alt={title} className="rounded border border-secondaryText object-cover" {...size} @@ -60,7 +55,7 @@ const ImageZabo = <Origin extends ZaboOrigin>({ <strong className="font-bold"> · {{ views }}</strong> </Trans> </div> - <div className="font-bold">{author}</div> + <div className="font-bold">{author.name}</div> </div> </div> ); diff --git a/src/app/components/organisms/Zabo/TextZabo.stories.tsx b/src/app/components/organisms/Zabo/TextZabo.stories.tsx index bb844eed..0f95637b 100644 --- a/src/app/components/organisms/Zabo/TextZabo.stories.tsx +++ b/src/app/components/organisms/Zabo/TextZabo.stories.tsx @@ -14,15 +14,11 @@ export default { const Template: StoryFn<typeof Zabo> = (args) => { const { t } = useTranslation(fallbackLng); const lineClampLevel = - args.contents[0].title.length > 40 - ? 2 - : args.contents[0].title.length > 20 - ? 1 - : 0; + args.title.length > 40 ? 2 : args.title.length > 20 ? 1 : 0; return ( <> - <div>length of title: {args.contents[0].title.length}</div> + <div>length of title: {args.title.length}</div> <br /> <code className="whitespace-pre"> {'const lineClampLevel = title.length > 40 ? 2 : title.length > 20 ? 1 : 0;\n\n' + @@ -82,7 +78,7 @@ const args = { content: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', createdAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, - author: '이정우', + author: { name: '인포팀', uuid: 'info' }, deadline: dayjs().add(1, 'd'), // organization: "INFOTEAM", }; diff --git a/src/app/components/organisms/Zabo/TextZabo.tsx b/src/app/components/organisms/Zabo/TextZabo.tsx index 5e82fdbe..c6cca3e4 100644 --- a/src/app/components/organisms/Zabo/TextZabo.tsx +++ b/src/app/components/organisms/Zabo/TextZabo.tsx @@ -2,13 +2,13 @@ import dayjs from 'dayjs'; import { Trans } from 'react-i18next'; import { PropsWithLng } from '@/app/i18next'; -import getLocaleContents from '@/utils/getLocaleContents'; import DDay from '../../molecules/DDay'; import { ZaboOrigin, ZaboProps } from './Zabo'; const TextZabo = <Origin extends ZaboOrigin>({ - contents, + content, + title, createdAt, views, author, @@ -22,8 +22,6 @@ const TextZabo = <Origin extends ZaboOrigin>({ const origin = width ? 'width' : 'height'; const antiOrigin = width ? 'height' : 'width'; const originSize = (origin === 'width' ? width : height) ?? 0; - const localContents = getLocaleContents(contents, lng); - const title = localContents[0].title; const lineClampLevel = title.length > 40 ? 2 : title.length > 20 ? 1 : 0; @@ -59,7 +57,7 @@ const TextZabo = <Origin extends ZaboOrigin>({ {title} </div> <div className="shrink overflow-hidden text-lg font-medium"> - {localContents[0].body} + {content} </div> <div className={'grow'} /> <div className="flex flex-col gap-2.5"> @@ -69,7 +67,7 @@ const TextZabo = <Origin extends ZaboOrigin>({ <strong className="font-bold"> · {{ views }}</strong> </Trans> </div> - <div className="font-bold">{author}</div> + <div className="font-bold">{author.name}</div> </div> </div> ); diff --git a/src/app/components/organisms/Zabo/Zabo.tsx b/src/app/components/organisms/Zabo/Zabo.tsx index a6c3e4a3..0db7af4f 100644 --- a/src/app/components/organisms/Zabo/Zabo.tsx +++ b/src/app/components/organisms/Zabo/Zabo.tsx @@ -19,10 +19,10 @@ export type ZaboProps<Origin extends ZaboOrigin> = PropsWithT< const Zabo = <IsImage extends boolean>( props: ZaboProps<ZaboOrigin> & PropsWithLng, ) => - props.imagesUrl.length > 0 ? ( + props.imageUrls.length > 0 ? ( <ImageZabo {...(props as ZaboProps<ZaboOrigin> & PropsWithLng)} - imagesUrl={props.imagesUrl} + imageUrls={props.imageUrls} /> ) : ( <TextZabo {...(props as ZaboProps<ZaboOrigin> & PropsWithLng)} /> diff --git a/src/app/components/templates/HowAboutThese/HowAboutThese.tsx b/src/app/components/templates/HowAboutThese/HowAboutThese.tsx index d2c58464..2a8136d4 100644 --- a/src/app/components/templates/HowAboutThese/HowAboutThese.tsx +++ b/src/app/components/templates/HowAboutThese/HowAboutThese.tsx @@ -56,7 +56,14 @@ const HowAboutThese = ({ lng }: PropsWithLng) => { > {notices.map((notice) => ( <Link key={notice.id} href={`/${lng}/notice/${notice.id}`}> - <Zabo t={t} width={300} {...notice} lng={lng} /> + <Zabo + t={t} + width={300} + {...notice} + lng={lng} + deadline={notice.deadline ?? null} + currentDeadline={notice.currentDeadline ?? null} // I don't know why it infers the type 'deadline' as optional + /> </Link> ))} </Masonry> diff --git a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx index a40fedb9..79a1ed3e 100644 --- a/src/app/components/templates/ResultZabo/ResultImageZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultImageZabo.tsx @@ -6,7 +6,6 @@ import Link from 'next/link'; import { Trans } from 'react-i18next/TransWithoutContext'; import { createTranslation } from '@/app/i18next'; -import getLocaleContents from '@/utils/getLocaleContents'; import HighlightedText from '../../molecules/HighlightedText'; import ZaboImage from '../../molecules/ZaboImage'; @@ -14,29 +13,25 @@ import Tags from '../../organisms/Tags'; import { ResultZaboProps } from './ResultZabo'; const ResultImageZabo = async ({ - contents, + title, createdAt, views, author, currentDeadline, tags, searchQuery, - imagesUrl, + imageUrls, id, lng, }: ResultZaboProps) => { const { t } = await createTranslation(lng); - const localeContents = getLocaleContents(contents, lng); - - const title = localeContents[0].title; - return ( <Link className={'w-full'} href={`/${lng}/notice/` + id}> <div className="box-border flex w-full flex-nowrap items-stretch justify-start gap-5 overflow-hidden rounded border border-secondaryText"> <ZaboImage width={230} // handle mobile - src={imagesUrl[0]} + src={imageUrls[0]} alt={title} style={{ objectFit: 'cover', objectPosition: 'center' }} /> @@ -68,10 +63,10 @@ const ResultImageZabo = async ({ <p className="text-start text-sm font-bold md:text-lg"> {searchQuery ? ( <HighlightedText query={searchQuery}> - {author} + {author.name} </HighlightedText> ) : ( - author + author.name )} </p> </div> diff --git a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx index ae56baa6..0f17cb2b 100644 --- a/src/app/components/templates/ResultZabo/ResultTextZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultTextZabo.tsx @@ -5,14 +5,14 @@ import Link from 'next/link'; import { Trans } from 'react-i18next/TransWithoutContext'; import { createTranslation } from '@/app/i18next'; -import getLocaleContents from '@/utils/getLocaleContents'; import HighlightedText from '../../molecules/HighlightedText'; import Tags from '../../organisms/Tags'; import { ResultZaboProps } from './ResultZabo'; const ResultTextZabo = async ({ - contents, + content, + title, createdAt, views, author, @@ -24,9 +24,6 @@ const ResultTextZabo = async ({ lng, }: ResultZaboProps) => { const { t } = await createTranslation(lng); - const localeContents = getLocaleContents(contents, lng); - - const title = localeContents[0].title; return ( <Link className={'w-full'} href={`/${lng}/notice/` + id}> @@ -56,9 +53,11 @@ const ResultTextZabo = async ({ <div className="flex items-center gap-0.5"> <div className="text-lg font-bold"> {searchQuery ? ( - <HighlightedText query={searchQuery}>{author}</HighlightedText> + <HighlightedText query={searchQuery}> + {author.name} + </HighlightedText> ) : ( - author + author.name )} </div> {/* organization here (for futer update) */} @@ -72,7 +71,7 @@ const ResultTextZabo = async ({ /> <div className="line-clamp-4 text-ellipsis text-start text-sm font-medium"> - {localeContents[0].body ?? t('zabo.noContent')} + {content ?? t('zabo.noContent')} </div> <div className="flex gap-0.5"> diff --git a/src/app/components/templates/ResultZabo/ResultZabo.tsx b/src/app/components/templates/ResultZabo/ResultZabo.tsx index 32d692b0..8df647b0 100644 --- a/src/app/components/templates/ResultZabo/ResultZabo.tsx +++ b/src/app/components/templates/ResultZabo/ResultZabo.tsx @@ -16,7 +16,7 @@ export type ResultZaboProps = PropsWithLng< >; const ResultZabo = (props: ResultZaboProps) => { - return props.imagesUrl.length > 0 ? ( // image exists in zabo + return props.imageUrls.length > 0 ? ( // image exists in zabo <ResultImageZabo {...(props as ResultZaboProps)} /> ) : ( <ResultTextZabo {...(props as ResultZaboProps)} /> diff --git a/src/app/components/templates/SearchResults/SearchResults.tsx b/src/app/components/templates/SearchResults/SearchResults.tsx index 5579eff2..ac927af7 100644 --- a/src/app/components/templates/SearchResults/SearchResults.tsx +++ b/src/app/components/templates/SearchResults/SearchResults.tsx @@ -33,7 +33,7 @@ const Results = async ({ event="search_result_click" properties={{ location: 'SearchPage', - isText: notice.imagesUrl.length === 0, + isText: notice.imageUrls.length === 0, }} key={notice.id} > diff --git a/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx b/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx index 5ae9b612..a3ff007a 100644 --- a/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx +++ b/src/app/components/templates/ZaboCarousel/ZaboCarousel.stories.tsx @@ -15,243 +15,20 @@ Default.args = { notices: [ { id: 1, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], + title: '인포팀 신규 부원 모집', + deadline: dayjs('2023-02-14T11:57:18.740Z'), + currentDeadline: null, + imageUrls: ['https://picsum.photos/200/300'], + documentUrls: [], + langs: ['ko'], + content: + '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), views: 110, - author: '이정우', + author: { name: '인포팀', uuid: 'info' }, tags: [], - files: [], - }, - { - id: 2, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 3, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 4, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 5, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 6, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 7, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], - }, - { - id: 8, - imagesUrl: ['https://picsum.photos/200/300'], - contents: [ - { - id: 1, - lang: 'ko', - title: '23년도 인포팀 신규 부원 모집', - body: '인포팀에서는 23년도 신규 부원을 모집합니다. 많은 지원 바랍니다.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - { - id: 2, - lang: 'en', - title: "We're recruiting new members for the Info Team in 2023", - body: 'The Info Team is recruiting new members for 2023. Please apply a lot.', - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - deadline: null, - noticeId: 1, - }, - ], - createdAt: dayjs('2023-02-14T11:57:18.740Z'), - updatedAt: dayjs('2023-02-14T11:57:18.740Z'), - views: 110, - author: '이정우', - tags: [], - files: [], + isReminded: false, + reactions: [], }, ], height: 300, diff --git a/src/generated/gql.ts b/src/generated/gql.ts index 24e631c5..3594a8a7 100644 --- a/src/generated/gql.ts +++ b/src/generated/gql.ts @@ -13,11 +13,13 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Therefore it is highly recommended to use the babel or swc plugin for production. */ const documents = { - "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n": types.GetNoticesDocument, - "\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n": types.CreateNoticeDocument, - "\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n }\n }\n }\n": types.AttachInternationalNoticeDocument, - "\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n": types.CreateAdditionalNoticeDocument, + "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n total\n }\n }\n": types.GetNoticesDocument, + "\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n": types.CreateNoticeDocument, + "\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n }\n }\n": types.AttachInternationalNoticeDocument, + "\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n": types.CreateAdditionalNoticeDocument, "\n mutation DeleteNotice($id: Int!) {\n deleteNotice(id: $id)\n }\n": types.DeleteNoticeDocument, + "\n mutation AddReaction($noticeId: Int!, $emoji: String!) {\n addReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n": types.AddReactionDocument, + "\n mutation DeleteReaction($noticeId: Int!, $emoji: String!) {\n deleteReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n": types.DeleteReactionDocument, }; /** @@ -37,23 +39,31 @@ export function gql(source: string): unknown; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"): (typeof documents)["\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n views\n currentDeadline\n createdAt\n updatedAt\n deletedAt\n author\n imagesUrl\n tags {\n id\n name\n }\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n total\n }\n }\n"]; +export function gql(source: "\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n total\n }\n }\n"): (typeof documents)["\n query GetNotices($offset: Int, $limit: Int) {\n notices(offset: $offset, limit: $limit, orderBy: RECENT) {\n list {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n total\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n"): (typeof documents)["\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n"]; +export function gql(source: "\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n"): (typeof documents)["\n mutation CreateNotice($title: String!, $body: String!, $deadline: Date, $tags: [Int!], $images: [String!]) {\n createNotice(title: $title, body: $body, deadline: $deadline, tags: $tags, images: $images) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n }\n }\n }\n"): (typeof documents)["\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n }\n }\n }\n"]; +export function gql(source: "\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n }\n }\n"): (typeof documents)["\n mutation AttachInternationalNotice($title: String!, $body: String!, $deadline: Date, $noticeId: Int!, $contentId: Int!, $lang: String!) {\n attachInternationalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId, contentId: $contentId, lang: $lang) {\n id\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function gql(source: "\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n"): (typeof documents)["\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n contents {\n id\n lang\n title\n body\n deadline\n createdAt\n noticeId\n }\n }\n }\n"]; +export function gql(source: "\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n"): (typeof documents)["\n mutation CreateAdditionalNotice($title: String, $body: String!, $deadline: Date, $noticeId: Int!) {\n createAdditionalNotice(title: $title, body: $body, deadline: $deadline, noticeId: $noticeId) {\n id\n additionalContents {\n id\n deadline\n content\n lang\n createdAt\n }\n }\n }\n"]; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql(source: "\n mutation DeleteNotice($id: Int!) {\n deleteNotice(id: $id)\n }\n"): (typeof documents)["\n mutation DeleteNotice($id: Int!) {\n deleteNotice(id: $id)\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation AddReaction($noticeId: Int!, $emoji: String!) {\n addReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n"): (typeof documents)["\n mutation AddReaction($noticeId: Int!, $emoji: String!) {\n addReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n"]; +/** + * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. + */ +export function gql(source: "\n mutation DeleteReaction($noticeId: Int!, $emoji: String!) {\n deleteReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n"): (typeof documents)["\n mutation DeleteReaction($noticeId: Int!, $emoji: String!) {\n deleteReaction(noticeId: $noticeId, emoji: $emoji) {\n id\n title\n deadline\n currentDeadline\n langs\n content\n author {\n name\n uuid\n }\n createdAt\n tags\n views\n imageUrls\n documentUrls\n isReminded\n reactions {\n emoji\n count\n isReacted\n }\n }\n }\n"]; export function gql(source: string) { return (documents as any)[source] ?? {}; diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 0f18610b..34b232f3 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -17,31 +17,37 @@ export type Scalars = { Date: { input: any; output: any; } }; +export type Author = { + __typename?: 'Author'; + name: Scalars['String']['output']; + uuid: Scalars['String']['output']; +}; + export type Content = { __typename?: 'Content'; - body: Scalars['String']['output']; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; deadline?: Maybe<Scalars['Date']['output']>; id: Scalars['Int']['output']; lang: Scalars['String']['output']; - noticeId: Scalars['Int']['output']; - title: Scalars['String']['output']; }; export type DetailedNotice = { __typename?: 'DetailedNotice'; - author: Scalars['String']['output']; - authorId: Scalars['String']['output']; - contents: Array<Content>; + additionalContents: Array<Content>; + author: Author; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe<Scalars['Date']['output']>; - deletedAt?: Maybe<Scalars['Date']['output']>; - files?: Maybe<Array<NoticeFile>>; + deadline?: Maybe<Scalars['Date']['output']>; + documentUrls: Array<Scalars['String']['output']>; id: Scalars['Int']['output']; - imagesUrl: Array<Scalars['String']['output']>; - reminder: Scalars['Boolean']['output']; - tags: Array<Tag>; - updatedAt: Scalars['Date']['output']; + imageUrls: Array<Scalars['String']['output']>; + isReminded: Scalars['Boolean']['output']; + langs: Array<Scalars['String']['output']>; + reactions: Array<Reaction>; + tags: Array<Scalars['String']['output']>; + title: Scalars['String']['output']; views: Scalars['Int']['output']; }; @@ -52,10 +58,18 @@ export enum MineNotice { export type Mutation = { __typename?: 'Mutation'; + addReaction: DetailedNotice; attachInternationalNotice: DetailedNotice; createAdditionalNotice: DetailedNotice; createNotice: DetailedNotice; deleteNotice: Scalars['Boolean']['output']; + deleteReaction: DetailedNotice; +}; + + +export type MutationAddReactionArgs = { + emoji: Scalars['String']['input']; + noticeId: Scalars['Int']['input']; }; @@ -90,31 +104,30 @@ export type MutationDeleteNoticeArgs = { id: Scalars['Int']['input']; }; + +export type MutationDeleteReactionArgs = { + emoji: Scalars['String']['input']; + noticeId: Scalars['Int']['input']; +}; + export type Notice = { __typename?: 'Notice'; - author: Scalars['String']['output']; - contents: Array<Content>; + author: Author; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe<Scalars['Date']['output']>; - deletedAt?: Maybe<Scalars['Date']['output']>; - files?: Maybe<Array<NoticeFile>>; + deadline?: Maybe<Scalars['Date']['output']>; + documentUrls: Array<Scalars['String']['output']>; id: Scalars['Int']['output']; - imagesUrl: Array<Scalars['String']['output']>; - tags: Array<Tag>; - updatedAt: Scalars['Date']['output']; + imageUrls: Array<Scalars['String']['output']>; + isReminded: Scalars['Boolean']['output']; + langs: Array<Scalars['String']['output']>; + reactions: Array<Reaction>; + tags: Array<Scalars['String']['output']>; + title: Scalars['String']['output']; views: Scalars['Int']['output']; }; -export type NoticeFile = { - __typename?: 'NoticeFile'; - createdAt: Scalars['Date']['output']; - name: Scalars['String']['output']; - noticeId: Scalars['Int']['output']; - type: Scalars['String']['output']; - url: Scalars['String']['output']; - uuid: Scalars['String']['output']; -}; - export type Notices = { __typename?: 'Notices'; list: Array<Notice>; @@ -148,10 +161,11 @@ export type QueryNoticesArgs = { tags?: InputMaybe<Array<Scalars['String']['input']>>; }; -export type Tag = { - __typename?: 'Tag'; - id: Scalars['Int']['output']; - name: Scalars['String']['output']; +export type Reaction = { + __typename?: 'Reaction'; + count: Scalars['Int']['output']; + emoji: Scalars['String']['output']; + isReacted: Scalars['Boolean']['output']; }; export type GetNoticesQueryVariables = Exact<{ @@ -160,7 +174,7 @@ export type GetNoticesQueryVariables = Exact<{ }>; -export type GetNoticesQuery = { __typename?: 'Query', notices: { __typename?: 'Notices', total: number, list: Array<{ __typename?: 'Notice', id: number, views: number, currentDeadline?: any | null, createdAt: any, updatedAt: any, deletedAt?: any | null, author: string, imagesUrl: Array<string>, tags: Array<{ __typename?: 'Tag', id: number, name: string }>, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any, noticeId: number }> }> } }; +export type GetNoticesQuery = { __typename?: 'Query', notices: { __typename?: 'Notices', total: number, list: Array<{ __typename?: 'Notice', id: number, title: string, deadline?: any | null, currentDeadline?: any | null, langs: Array<string>, content: string, createdAt: any, tags: Array<string>, views: number, imageUrls: Array<string>, documentUrls: Array<string>, isReminded: boolean, author: { __typename?: 'Author', name: string, uuid: string }, reactions: Array<{ __typename?: 'Reaction', emoji: string, count: number, isReacted: boolean }> }> } }; export type CreateNoticeMutationVariables = Exact<{ title: Scalars['String']['input']; @@ -171,7 +185,7 @@ export type CreateNoticeMutationVariables = Exact<{ }>; -export type CreateNoticeMutation = { __typename?: 'Mutation', createNotice: { __typename?: 'DetailedNotice', id: number, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any, noticeId: number }> } }; +export type CreateNoticeMutation = { __typename?: 'Mutation', createNotice: { __typename?: 'DetailedNotice', id: number, additionalContents: Array<{ __typename?: 'Content', id: number, deadline?: any | null, content: string, lang: string, createdAt: any }> } }; export type AttachInternationalNoticeMutationVariables = Exact<{ title: Scalars['String']['input']; @@ -183,7 +197,7 @@ export type AttachInternationalNoticeMutationVariables = Exact<{ }>; -export type AttachInternationalNoticeMutation = { __typename?: 'Mutation', attachInternationalNotice: { __typename?: 'DetailedNotice', id: number, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any }> } }; +export type AttachInternationalNoticeMutation = { __typename?: 'Mutation', attachInternationalNotice: { __typename?: 'DetailedNotice', id: number } }; export type CreateAdditionalNoticeMutationVariables = Exact<{ title?: InputMaybe<Scalars['String']['input']>; @@ -193,7 +207,7 @@ export type CreateAdditionalNoticeMutationVariables = Exact<{ }>; -export type CreateAdditionalNoticeMutation = { __typename?: 'Mutation', createAdditionalNotice: { __typename?: 'DetailedNotice', id: number, contents: Array<{ __typename?: 'Content', id: number, lang: string, title: string, body: string, deadline?: any | null, createdAt: any, noticeId: number }> } }; +export type CreateAdditionalNoticeMutation = { __typename?: 'Mutation', createAdditionalNotice: { __typename?: 'DetailedNotice', id: number, additionalContents: Array<{ __typename?: 'Content', id: number, deadline?: any | null, content: string, lang: string, createdAt: any }> } }; export type DeleteNoticeMutationVariables = Exact<{ id: Scalars['Int']['input']; @@ -202,9 +216,27 @@ export type DeleteNoticeMutationVariables = Exact<{ export type DeleteNoticeMutation = { __typename?: 'Mutation', deleteNotice: boolean }; +export type AddReactionMutationVariables = Exact<{ + noticeId: Scalars['Int']['input']; + emoji: Scalars['String']['input']; +}>; + + +export type AddReactionMutation = { __typename?: 'Mutation', addReaction: { __typename?: 'DetailedNotice', id: number, title: string, deadline?: any | null, currentDeadline?: any | null, langs: Array<string>, content: string, createdAt: any, tags: Array<string>, views: number, imageUrls: Array<string>, documentUrls: Array<string>, isReminded: boolean, author: { __typename?: 'Author', name: string, uuid: string }, reactions: Array<{ __typename?: 'Reaction', emoji: string, count: number, isReacted: boolean }> } }; + +export type DeleteReactionMutationVariables = Exact<{ + noticeId: Scalars['Int']['input']; + emoji: Scalars['String']['input']; +}>; + + +export type DeleteReactionMutation = { __typename?: 'Mutation', deleteReaction: { __typename?: 'DetailedNotice', id: number, title: string, deadline?: any | null, currentDeadline?: any | null, langs: Array<string>, content: string, createdAt: any, tags: Array<string>, views: number, imageUrls: Array<string>, documentUrls: Array<string>, isReminded: boolean, author: { __typename?: 'Author', name: string, uuid: string }, reactions: Array<{ __typename?: 'Reaction', emoji: string, count: number, isReacted: boolean }> } }; + -export const GetNoticesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"EnumValue","value":"RECENT"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"imagesUrl"}},{"kind":"Field","name":{"kind":"Name","value":"tags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"}}]}}]}}]} as unknown as DocumentNode<GetNoticesQuery, GetNoticesQueryVariables>; -export const CreateNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tags"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"images"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"tags"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tags"}}},{"kind":"Argument","name":{"kind":"Name","value":"images"},"value":{"kind":"Variable","name":{"kind":"Name","value":"images"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}}]}}]} as unknown as DocumentNode<CreateNoticeMutation, CreateNoticeMutationVariables>; -export const AttachInternationalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttachInternationalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"lang"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attachInternationalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"contentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<AttachInternationalNoticeMutation, AttachInternationalNoticeMutationVariables>; -export const CreateAdditionalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAdditionalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createAdditionalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"contents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"noticeId"}}]}}]}}]}}]} as unknown as DocumentNode<CreateAdditionalNoticeMutation, CreateAdditionalNoticeMutationVariables>; -export const DeleteNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode<DeleteNoticeMutation, DeleteNoticeMutationVariables>; \ No newline at end of file +export const GetNoticesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotices"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"offset"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notices"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"offset"},"value":{"kind":"Variable","name":{"kind":"Name","value":"offset"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"EnumValue","value":"RECENT"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"list"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"langs"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"uuid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrls"}},{"kind":"Field","name":{"kind":"Name","value":"documentUrls"}},{"kind":"Field","name":{"kind":"Name","value":"isReminded"}},{"kind":"Field","name":{"kind":"Name","value":"reactions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"emoji"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"isReacted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"total"}}]}}]}}]} as unknown as DocumentNode<GetNoticesQuery, GetNoticesQueryVariables>; +export const CreateNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"tags"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"images"}},"type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"tags"},"value":{"kind":"Variable","name":{"kind":"Name","value":"tags"}}},{"kind":"Argument","name":{"kind":"Name","value":"images"},"value":{"kind":"Variable","name":{"kind":"Name","value":"images"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"additionalContents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<CreateNoticeMutation, CreateNoticeMutationVariables>; +export const AttachInternationalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AttachInternationalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"lang"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"attachInternationalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"contentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"contentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"lang"},"value":{"kind":"Variable","name":{"kind":"Name","value":"lang"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<AttachInternationalNoticeMutation, AttachInternationalNoticeMutationVariables>; +export const CreateAdditionalNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateAdditionalNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"title"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"body"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Date"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createAdditionalNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"title"},"value":{"kind":"Variable","name":{"kind":"Name","value":"title"}}},{"kind":"Argument","name":{"kind":"Name","value":"body"},"value":{"kind":"Variable","name":{"kind":"Name","value":"body"}}},{"kind":"Argument","name":{"kind":"Name","value":"deadline"},"value":{"kind":"Variable","name":{"kind":"Name","value":"deadline"}}},{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"additionalContents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"lang"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<CreateAdditionalNoticeMutation, CreateAdditionalNoticeMutationVariables>; +export const DeleteNoticeDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteNotice"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteNotice"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode<DeleteNoticeMutation, DeleteNoticeMutationVariables>; +export const AddReactionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddReaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"emoji"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addReaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"emoji"},"value":{"kind":"Variable","name":{"kind":"Name","value":"emoji"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"langs"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"uuid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrls"}},{"kind":"Field","name":{"kind":"Name","value":"documentUrls"}},{"kind":"Field","name":{"kind":"Name","value":"isReminded"}},{"kind":"Field","name":{"kind":"Name","value":"reactions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"emoji"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"isReacted"}}]}}]}}]}}]} as unknown as DocumentNode<AddReactionMutation, AddReactionMutationVariables>; +export const DeleteReactionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteReaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"emoji"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteReaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"noticeId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"noticeId"}}},{"kind":"Argument","name":{"kind":"Name","value":"emoji"},"value":{"kind":"Variable","name":{"kind":"Name","value":"emoji"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"deadline"}},{"kind":"Field","name":{"kind":"Name","value":"currentDeadline"}},{"kind":"Field","name":{"kind":"Name","value":"langs"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"author"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"uuid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"tags"}},{"kind":"Field","name":{"kind":"Name","value":"views"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrls"}},{"kind":"Field","name":{"kind":"Name","value":"documentUrls"}},{"kind":"Field","name":{"kind":"Name","value":"isReminded"}},{"kind":"Field","name":{"kind":"Name","value":"reactions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"emoji"}},{"kind":"Field","name":{"kind":"Name","value":"count"}},{"kind":"Field","name":{"kind":"Name","value":"isReacted"}}]}}]}}]}}]} as unknown as DocumentNode<DeleteReactionMutation, DeleteReactionMutationVariables>; \ No newline at end of file diff --git a/src/generated/server.ts b/src/generated/server.ts index 8019e1d2..911a1d3d 100644 --- a/src/generated/server.ts +++ b/src/generated/server.ts @@ -18,31 +18,37 @@ export type Scalars = { Date: { input: any; output: any; } }; +export type Author = { + __typename?: 'Author'; + name: Scalars['String']['output']; + uuid: Scalars['String']['output']; +}; + export type Content = { __typename?: 'Content'; - body: Scalars['String']['output']; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; deadline?: Maybe<Scalars['Date']['output']>; id: Scalars['Int']['output']; lang: Scalars['String']['output']; - noticeId: Scalars['Int']['output']; - title: Scalars['String']['output']; }; export type DetailedNotice = { __typename?: 'DetailedNotice'; - author: Scalars['String']['output']; - authorId: Scalars['String']['output']; - contents: Array<Content>; + additionalContents: Array<Content>; + author: Author; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe<Scalars['Date']['output']>; - deletedAt?: Maybe<Scalars['Date']['output']>; - files?: Maybe<Array<NoticeFile>>; + deadline?: Maybe<Scalars['Date']['output']>; + documentUrls: Array<Scalars['String']['output']>; id: Scalars['Int']['output']; - imagesUrl: Array<Scalars['String']['output']>; - reminder: Scalars['Boolean']['output']; - tags: Array<Tag>; - updatedAt: Scalars['Date']['output']; + imageUrls: Array<Scalars['String']['output']>; + isReminded: Scalars['Boolean']['output']; + langs: Array<Scalars['String']['output']>; + reactions: Array<Reaction>; + tags: Array<Scalars['String']['output']>; + title: Scalars['String']['output']; views: Scalars['Int']['output']; }; @@ -53,10 +59,18 @@ export enum MineNotice { export type Mutation = { __typename?: 'Mutation'; + addReaction: DetailedNotice; attachInternationalNotice: DetailedNotice; createAdditionalNotice: DetailedNotice; createNotice: DetailedNotice; deleteNotice: Scalars['Boolean']['output']; + deleteReaction: DetailedNotice; +}; + + +export type MutationAddReactionArgs = { + emoji: Scalars['String']['input']; + noticeId: Scalars['Int']['input']; }; @@ -91,31 +105,30 @@ export type MutationDeleteNoticeArgs = { id: Scalars['Int']['input']; }; + +export type MutationDeleteReactionArgs = { + emoji: Scalars['String']['input']; + noticeId: Scalars['Int']['input']; +}; + export type Notice = { __typename?: 'Notice'; - author: Scalars['String']['output']; - contents: Array<Content>; + author: Author; + content: Scalars['String']['output']; createdAt: Scalars['Date']['output']; currentDeadline?: Maybe<Scalars['Date']['output']>; - deletedAt?: Maybe<Scalars['Date']['output']>; - files?: Maybe<Array<NoticeFile>>; + deadline?: Maybe<Scalars['Date']['output']>; + documentUrls: Array<Scalars['String']['output']>; id: Scalars['Int']['output']; - imagesUrl: Array<Scalars['String']['output']>; - tags: Array<Tag>; - updatedAt: Scalars['Date']['output']; + imageUrls: Array<Scalars['String']['output']>; + isReminded: Scalars['Boolean']['output']; + langs: Array<Scalars['String']['output']>; + reactions: Array<Reaction>; + tags: Array<Scalars['String']['output']>; + title: Scalars['String']['output']; views: Scalars['Int']['output']; }; -export type NoticeFile = { - __typename?: 'NoticeFile'; - createdAt: Scalars['Date']['output']; - name: Scalars['String']['output']; - noticeId: Scalars['Int']['output']; - type: Scalars['String']['output']; - url: Scalars['String']['output']; - uuid: Scalars['String']['output']; -}; - export type Notices = { __typename?: 'Notices'; list: Array<Notice>; @@ -149,10 +162,11 @@ export type QueryNoticesArgs = { tags?: InputMaybe<Array<Scalars['String']['input']>>; }; -export type Tag = { - __typename?: 'Tag'; - id: Scalars['Int']['output']; - name: Scalars['String']['output']; +export type Reaction = { + __typename?: 'Reaction'; + count: Scalars['Int']['output']; + emoji: Scalars['String']['output']; + isReacted: Scalars['Boolean']['output']; }; @@ -226,6 +240,7 @@ export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs /** Mapping between all available schema types and the resolvers types */ export type ResolversTypes = { + Author: ResolverTypeWrapper<Author>; Boolean: ResolverTypeWrapper<Scalars['Boolean']['output']>; Content: ResolverTypeWrapper<Content>; Date: ResolverTypeWrapper<Scalars['Date']['output']>; @@ -234,16 +249,16 @@ export type ResolversTypes = { MineNotice: MineNotice; Mutation: ResolverTypeWrapper<{}>; Notice: ResolverTypeWrapper<Notice>; - NoticeFile: ResolverTypeWrapper<NoticeFile>; Notices: ResolverTypeWrapper<Notices>; OrderBy: OrderBy; Query: ResolverTypeWrapper<{}>; + Reaction: ResolverTypeWrapper<Reaction>; String: ResolverTypeWrapper<Scalars['String']['output']>; - Tag: ResolverTypeWrapper<Tag>; }; /** Mapping between all available schema types and the resolvers parents */ export type ResolversParentTypes = { + Author: Author; Boolean: Scalars['Boolean']['output']; Content: Content; Date: Scalars['Date']['output']; @@ -251,21 +266,24 @@ export type ResolversParentTypes = { Int: Scalars['Int']['output']; Mutation: {}; Notice: Notice; - NoticeFile: NoticeFile; Notices: Notices; Query: {}; + Reaction: Reaction; String: Scalars['String']['output']; - Tag: Tag; +}; + +export type AuthorResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Author'] = ResolversParentTypes['Author']> = { + name?: Resolver<ResolversTypes['String'], ParentType, ContextType>; + uuid?: Resolver<ResolversTypes['String'], ParentType, ContextType>; + __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; }; export type ContentResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Content'] = ResolversParentTypes['Content']> = { - body?: Resolver<ResolversTypes['String'], ParentType, ContextType>; + content?: Resolver<ResolversTypes['String'], ParentType, ContextType>; createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; deadline?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; lang?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - noticeId?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; - title?: Resolver<ResolversTypes['String'], ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; }; @@ -274,54 +292,51 @@ export interface DateScalarConfig extends GraphQLScalarTypeConfig<ResolversTypes } export type DetailedNoticeResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['DetailedNotice'] = ResolversParentTypes['DetailedNotice']> = { - author?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - authorId?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - contents?: Resolver<Array<ResolversTypes['Content']>, ParentType, ContextType>; + additionalContents?: Resolver<Array<ResolversTypes['Content']>, ParentType, ContextType>; + author?: Resolver<ResolversTypes['Author'], ParentType, ContextType>; + content?: Resolver<ResolversTypes['String'], ParentType, ContextType>; createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; currentDeadline?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; - deletedAt?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; - files?: Resolver<Maybe<Array<ResolversTypes['NoticeFile']>>, ParentType, ContextType>; + deadline?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; + documentUrls?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; - imagesUrl?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; - reminder?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>; - tags?: Resolver<Array<ResolversTypes['Tag']>, ParentType, ContextType>; - updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; + imageUrls?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + isReminded?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>; + langs?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + reactions?: Resolver<Array<ResolversTypes['Reaction']>, ParentType, ContextType>; + tags?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + title?: Resolver<ResolversTypes['String'], ParentType, ContextType>; views?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; }; export type MutationResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']> = { + addReaction?: Resolver<ResolversTypes['DetailedNotice'], ParentType, ContextType, RequireFields<MutationAddReactionArgs, 'emoji' | 'noticeId'>>; attachInternationalNotice?: Resolver<ResolversTypes['DetailedNotice'], ParentType, ContextType, RequireFields<MutationAttachInternationalNoticeArgs, 'body' | 'contentId' | 'lang' | 'noticeId' | 'title'>>; createAdditionalNotice?: Resolver<ResolversTypes['DetailedNotice'], ParentType, ContextType, RequireFields<MutationCreateAdditionalNoticeArgs, 'body' | 'noticeId'>>; createNotice?: Resolver<ResolversTypes['DetailedNotice'], ParentType, ContextType, RequireFields<MutationCreateNoticeArgs, 'body' | 'title'>>; deleteNotice?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<MutationDeleteNoticeArgs, 'id'>>; + deleteReaction?: Resolver<ResolversTypes['DetailedNotice'], ParentType, ContextType, RequireFields<MutationDeleteReactionArgs, 'emoji' | 'noticeId'>>; }; export type NoticeResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Notice'] = ResolversParentTypes['Notice']> = { - author?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - contents?: Resolver<Array<ResolversTypes['Content']>, ParentType, ContextType>; + author?: Resolver<ResolversTypes['Author'], ParentType, ContextType>; + content?: Resolver<ResolversTypes['String'], ParentType, ContextType>; createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; currentDeadline?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; - deletedAt?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; - files?: Resolver<Maybe<Array<ResolversTypes['NoticeFile']>>, ParentType, ContextType>; + deadline?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>; + documentUrls?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; - imagesUrl?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; - tags?: Resolver<Array<ResolversTypes['Tag']>, ParentType, ContextType>; - updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; + imageUrls?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + isReminded?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>; + langs?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + reactions?: Resolver<Array<ResolversTypes['Reaction']>, ParentType, ContextType>; + tags?: Resolver<Array<ResolversTypes['String']>, ParentType, ContextType>; + title?: Resolver<ResolversTypes['String'], ParentType, ContextType>; views?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; }; -export type NoticeFileResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['NoticeFile'] = ResolversParentTypes['NoticeFile']> = { - createdAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>; - name?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - noticeId?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; - type?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - url?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - uuid?: Resolver<ResolversTypes['String'], ParentType, ContextType>; - __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; -}; - export type NoticesResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Notices'] = ResolversParentTypes['Notices']> = { list?: Resolver<Array<ResolversTypes['Notice']>, ParentType, ContextType>; total?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; @@ -333,21 +348,22 @@ export type QueryResolvers<ContextType = MyContext, ParentType extends Resolvers notices?: Resolver<ResolversTypes['Notices'], ParentType, ContextType, Partial<QueryNoticesArgs>>; }; -export type TagResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Tag'] = ResolversParentTypes['Tag']> = { - id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; - name?: Resolver<ResolversTypes['String'], ParentType, ContextType>; +export type ReactionResolvers<ContextType = MyContext, ParentType extends ResolversParentTypes['Reaction'] = ResolversParentTypes['Reaction']> = { + count?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; + emoji?: Resolver<ResolversTypes['String'], ParentType, ContextType>; + isReacted?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; }; export type Resolvers<ContextType = MyContext> = { + Author?: AuthorResolvers<ContextType>; Content?: ContentResolvers<ContextType>; Date?: GraphQLScalarType; DetailedNotice?: DetailedNoticeResolvers<ContextType>; Mutation?: MutationResolvers<ContextType>; Notice?: NoticeResolvers<ContextType>; - NoticeFile?: NoticeFileResolvers<ContextType>; Notices?: NoticesResolvers<ContextType>; Query?: QueryResolvers<ContextType>; - Tag?: TagResolvers<ContextType>; + Reaction?: ReactionResolvers<ContextType>; }; diff --git a/src/mock/dummy-mypage-articles.ts b/src/mock/dummy-mypage-articles.ts index 23444ecd..d566c05a 100644 --- a/src/mock/dummy-mypage-articles.ts +++ b/src/mock/dummy-mypage-articles.ts @@ -24,7 +24,7 @@ const articles1 = [ body: '', deadline: '', id: 0, - imagesUrl: [], + imageUrls: [], tags: [], views: 0, })); @@ -40,7 +40,7 @@ const articles2 = [ body: '', deadline: '', id: 0, - imagesUrl: [], + imageUrls: [], tags: [], views: 0, })); diff --git a/src/utils/getLocaleContents.ts b/src/utils/getLocaleContents.ts deleted file mode 100644 index 7d7310bf..00000000 --- a/src/utils/getLocaleContents.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Content } from '@/api/notice/notice'; - -const getLocaleContents = (contents: Content[], language: string) => { - const localeContents = contents.filter( - (content) => content.lang === language, - ); - - return localeContents.length > 0 ? localeContents : contents; -}; - -export default getLocaleContents; diff --git a/tsconfig.json b/tsconfig.json index 67ae7afe..19e7315d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,7 +29,7 @@ "next-env.d.ts", "**/*.ts", "**/*.tsx", - ".next/types/**/*.ts" + ".next/types/**/*.ts", ], "exclude": ["node_modules"] }