Skip to content

Commit

Permalink
Fix: 소켓 api 변경사항 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
LeHiHo committed Jan 16, 2024
1 parent f2938e7 commit 004583a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/@types/socket.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ type subItemMessage = (response: {
data: {
tripId: number;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
tripItems: {
tripItemId: number;
tourItemId: number;
name: string;
thumbnailUrl: string;
category: string;
transportation: string;
seqNum: number;
visitDate: string;
price: number;
Expand All @@ -40,6 +40,7 @@ type subPathMessage = (response: {
data: {
tripId: number;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
paths: {
fromTripItemId: number;
toTripItemId: number;
Expand All @@ -49,7 +50,6 @@ type subPathMessage = (response: {
fromLatitude: string;
toLongitude: string;
toLatitude: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
pathInfo: {
price: number;
totalDistance: number;
Expand Down Expand Up @@ -120,7 +120,6 @@ interface pubUpdateTripItem {
}

interface pubUpdateTransportation {
tripId: number;
visitDate: string;
transportation: 'CAR' | 'PUBLIC_TRANSPORTATION';
}
Expand Down
6 changes: 3 additions & 3 deletions src/api/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ export const pubUpdateTripItem = (
});
};

// 여행 아이템 방문 교통 수단 변경 이벤트 발생시
// 여행 날짜별 교통 수단 변경 이벤트 발생시 (01/16 업데이트)
export const pubUpdateTransportation = (
pubUpdateTransportation: pubUpdateTransportation,
tripItemId: number,
trips: number,
) => {
socketClient.publish({
destination: `/pub/tripItems/${tripItemId}/updateTransportation`,
destination: `/pub/trips/${trips}/updateTransportation`,
body: JSON.stringify(pubUpdateTransportation),
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/recoil/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const tripIdState = atom<string | null>({

export const visitDateState = atom<{ visitDate: string } | null>({
key: 'visitDateState',
default: { visitDate: '2024-01-05' },
default: { visitDate: '2024-01-03' },
});

export const memberIdState = atom<{ memberId: number } | null>({
Expand Down

0 comments on commit 004583a

Please sign in to comment.