From df7deb1dec61af05858092033ebf3f6aca328871 Mon Sep 17 00:00:00 2001 From: boxak Date: Mon, 24 Jul 2023 00:06:58 +0900 Subject: [PATCH] =?UTF-8?q?friend=20post=20api=20=EC=9E=84=EC=8B=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/FriendStore.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/store/FriendStore.ts b/src/store/FriendStore.ts index f0c22a5..2d07568 100644 --- a/src/store/FriendStore.ts +++ b/src/store/FriendStore.ts @@ -7,6 +7,7 @@ import {BirthProto} from "../prototypes/common/BirthProto"; import React, {useEffect} from "react"; import {RelationshipGetRequestProto} from "../prototypes/relationship/RelationshipRequestProto"; import { YnTypeProto } from "../prototypes/common/type/YnTypeProto"; +import { DateProto } from "../prototypes/common/DateProto"; class FriendStore { rootStore : typeof RootStore; @@ -50,17 +51,22 @@ class FriendStore { getEdit?: string|null, getSequence?: string|null ){ - const request : FriendPostProto = { + + const birthday : DateProto = { + year: parseInt(birth.split("-")[0]), + month: parseInt(birth.split("-")[1]), + day: parseInt(birth.split("-")[2]) + } + + const birthInfo : BirthProto = { + date : birthday, + isLunar : isLunar ? YnTypeProto.Y : YnTypeProto.N + } + + const request : FriendPostProto = { nicknames: friendName, relationship: friendRelation === "directInput" ? friendDirectInput : friendRelation, - birth: birthUnKnown ? null : { - isLunar: isLunar ? YnTypeProto.Y : YnTypeProto.N, - date: { - year: parseInt(birth.split("-")[0]), - month: parseInt(birth.split("-")[1]), - day: parseInt(birth.split("-")[2]) - } - }, + birth: birthUnKnown ? null : birthInfo, memo: friendMemo };