Skip to content

Commit

Permalink
Merge pull request #137 from ASAP-Lettering/feat/#135
Browse files Browse the repository at this point in the history
  • Loading branch information
yyypearl authored Jan 28, 2025
2 parents 13a1194 + 93325cd commit fc33078
Show file tree
Hide file tree
Showing 34 changed files with 1,595 additions and 1,305 deletions.
3 changes: 3 additions & 0 deletions public/assets/icons/ic_camera.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions public/assets/images/bottomsheet/bottomsheet_letter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions src/api/draft/send.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { authClient } from '@/api/client';

// 임시 저장하기
export const postDraftLetter = async ({
draftId,
content,
receiverName,
images
}: {
draftId: string;
content: string;
receiverName: string;
images: string[];
}) => {
return await authClient.post(`/api/v1/letters/drafts/${draftId}`, {
content,
receiverName,
images
});
};

// 임시 저장 삭제
export const deleteDraftLetter = async (draftId: string) => {
return await authClient.delete(`/api/v1/letters/drafts/${draftId}`);
};

// 임시 저장 키 발급
export const postDraftKey = async () => {
return await authClient.post(`/api/v1/letters/drafts/key`);
};

// 임시 저장 목록 조회
export const getDraftList = async () => {
return await authClient.get(`/api/v1/letters/drafts`);
};

// 임시 저장 조회
export const getDraftLetter = async (draftKey: string) => {
return await authClient.get(`/api/v1/letters/drafts/${draftKey}`);
};

// 임시 저장 개수 조회
export const getDraftCount = async () => {
return await authClient.get(`/api/v1/letters/drafts/count`);
};
45 changes: 45 additions & 0 deletions src/api/draft/store.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { authClient } from '@/api/client';

// 실물 편지 임시 저장하기
export const postDraftPhysicalLetter = async ({
draftId,
content,
senderName,
images
}: {
draftId: string;
content: string;
senderName: string;
images: string[];
}) => {
return await authClient.post(`/api/v1/letters/drafts/physical/${draftId}`, {
content,
senderName,
images
});
};

// 실물 편지 임시 저장 삭제
export const deleteDraftPhysicalLetter = async (draftId: string) => {
return await authClient.delete(`/api/v1/letters/drafts/physical/${draftId}`);
};

// 실물 편지 임시 저장 키 발급
export const postDraftPhysicalKey = async () => {
return await authClient.post(`/api/v1/letters/drafts/physical/key`);
};

// 실물 편지 임시 저장 목록 조회
export const getDraftPhysicalList = async () => {
return await authClient.get(`/api/v1/letters/drafts/physical`);
};

// 실물 편지 임시 저장 조회
export const getDraftPhysicalLetter = async (draftKey: string) => {
return await authClient.get(`/api/v1/letters/drafts/physical/${draftKey}`);
};

// 실물 편지 임시 저장 개수 조회
export const getDraftPhysicalCount = async () => {
return await authClient.get(`/api/v1/letters/drafts/physical/count`);
};
20 changes: 11 additions & 9 deletions src/api/letter/letter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { getAccessToken } from "@/utils/storage";
import client, { authClient } from "../client";
import { authClient } from '../client';

// 편지 조회
export const getLetter = async (letterId: string) => {
Expand All @@ -21,31 +20,34 @@ export const postPhysicalLetter = async ({
content,
images,
templateType,
draftId
}: {
senderName: string;
content: string;
images: string[];
templateType: number;
draftId: string | null;
}) => {
return await authClient.post(`/api/v1/letters/physical/receive`, {
senderName,
content,
images,
templateType,
draftId
});
};

// 이미지 업로드
export const uploadImage = async ({ imageUrl }: { imageUrl: string }) => {
return await authClient.post(`/api/v1/images`, {
imageUrl,
imageUrl
});
};

// 편지 열람 가능 검증
export const verifyLetter = async (letterCode: string) => {
return await authClient.put(`/api/v1/letters/verify`, {
letterCode: letterCode,
letterCode: letterCode
});
};

Expand All @@ -57,7 +59,7 @@ export const getVerifyedLetter = async (letterId: string) => {
// 편지 수령
export const saveVerifyedLetter = async (letterId: string) => {
return await authClient.post(`/api/v1/letters/verify/receive`, {
letterId: letterId,
letterId: letterId
});
};

Expand All @@ -67,7 +69,7 @@ export const putLetter = async ({
senderName,
content,
images,
templateType,
templateType
}: {
letterId: string;
senderName: string;
Expand All @@ -79,7 +81,7 @@ export const putLetter = async ({
senderName,
content,
images,
templateType,
templateType
});
};

Expand All @@ -89,7 +91,7 @@ export const putIndependentLetter = async ({
senderName,
content,
images,
templateType,
templateType
}: {
letterId: string;
senderName: string;
Expand All @@ -103,7 +105,7 @@ export const putIndependentLetter = async ({
senderName,
content,
images,
templateType,
templateType
}
);
};
Expand Down
50 changes: 3 additions & 47 deletions src/api/send/send.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { authClient } from "@/api/client";
import { authClient } from '@/api/client';

// 편지 쓰기
export const postSendLtter = async ({
receiverName,
content,
images,
templateType,
draftId,
draftId
}: {
receiverName: string;
content: string;
Expand All @@ -19,50 +19,6 @@ export const postSendLtter = async ({
content,
images,
templateType,
draftId,
draftId
});
};

// 임시 저장하기
export const postDraftLetter = async ({
draftId,
content,
receiverName,
images,
}: {
draftId: string;
content: string;
receiverName: string;
images: string[];
}) => {
return await authClient.post(`/api/v1/letters/drafts/${draftId}`, {
content,
receiverName,
images,
});
};

// 임시 저장 삭제
export const deleteDraftLetter = async (draftId: string) => {
return await authClient.delete(`/api/v1/letters/drafts/${draftId}`);
};

// 임시 저장 키 발급
export const postDraftKey = async () => {
return await authClient.post(`/api/v1/letters/drafts/key`);
};

// 임시 저장 목록 조회
export const getDraftList = async () => {
return await authClient.get(`/api/v1/letters/drafts`);
};

// 임시 저장 조회
export const getDraftLetter = async (draftKey: string) => {
return await authClient.get(`/api/v1/letters/drafts/${draftKey}`);
};

// 임시 저장 개수 조회
export const getDraftCount = async () => {
return await authClient.get(`/api/v1/letters/drafts/count`);
};
Loading

0 comments on commit fc33078

Please sign in to comment.