Skip to content

Commit

Permalink
Merge pull request #114 from bsideproject/jw-dev
Browse files Browse the repository at this point in the history
friend post api 임시 수정
  • Loading branch information
boxak authored Jul 23, 2023
2 parents 73e6e02 + df7deb1 commit d85a18e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/store/FriendStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
};

Expand Down

0 comments on commit d85a18e

Please sign in to comment.