diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx
index 9f8db63..5d5b7f8 100644
--- a/src/components/Modal/index.tsx
+++ b/src/components/Modal/index.tsx
@@ -144,9 +144,11 @@ const ModalBodyContent = ({ children }: { children: ReactNode }) => {
const CenterModalConfirm = ({
confirmText,
onConfirm = () => {},
+ disabled = false,
}: {
confirmText: ReactNode
onConfirm?: () => void
+ disabled?: boolean
}) => {
const { onClose } = useContext(ModalContext)
@@ -161,6 +163,7 @@ const CenterModalConfirm = ({
size="md"
className="my-4 flex items-center justify-center gap-1"
onClick={clickHandler}
+ disabled={disabled}
>
{confirmText}
diff --git a/src/components/Popup/index.tsx b/src/components/Popup/index.tsx
index 20ea3e9..b18dd8b 100644
--- a/src/components/Popup/index.tsx
+++ b/src/components/Popup/index.tsx
@@ -37,7 +37,7 @@ const Popup = ({
if (!isOpen) return null
const className = twMerge(
- 'absolute z-5',
+ 'absolute z-[5]',
yPosition === 'top' ? 'top' : 'bottom',
xPosition === 'left' ? 'left-0' : 'right-0',
)
diff --git a/src/lib/api/myBoard.ts b/src/lib/api/myBoard.ts
index e8059c8..ded64ec 100644
--- a/src/lib/api/myBoard.ts
+++ b/src/lib/api/myBoard.ts
@@ -1,15 +1,19 @@
-import { deleteApi, get } from '@/lib/api/base'
+import { deleteApi, get, put } from '@/lib/api/base'
import { MyBoardList } from '@/types'
export const getMyBoards = async (
page = 1,
size = 10,
+ filter: 'OWNER' | 'PARTICIPANT' = 'OWNER',
): Promise => {
- const res = await get(`/api/v1/my/boards?page=${page}&size=${size}`, {
- next: {
- tags: ['myBoard', `myBoard:${page},${size}`],
+ const res = await get(
+ `/api/v2/my/boards?page=${page}&size=${size}&filter=${filter}`,
+ {
+ next: {
+ tags: ['myBoard', `myBoard:${page},${size},${filter}`],
+ },
},
- })
+ )
return {
pagination: {
@@ -22,6 +26,12 @@ export const getMyBoards = async (
}
}
+export const changeMyBoardName = (id: string, title: string) => {
+ return put(`/api/v1/my/boards/${id}`, {
+ body: JSON.stringify({ title }),
+ })
+}
+
export const deleteMyBoard = (id: string) => {
return deleteApi(`/api/v1/my/boards/${id}`)
}
diff --git a/src/lib/api/polaroid.ts b/src/lib/api/polaroid.ts
index fc157ea..163f957 100644
--- a/src/lib/api/polaroid.ts
+++ b/src/lib/api/polaroid.ts
@@ -21,6 +21,7 @@ export const postPolaroid = async (
})
revalidateTag(`board:${boardId}`)
+ revalidateTag('myBoard')
return result.data
}
diff --git a/src/lib/utils/query.ts b/src/lib/utils/query.ts
new file mode 100644
index 0000000..9008bdf
--- /dev/null
+++ b/src/lib/utils/query.ts
@@ -0,0 +1,10 @@
+export const createQueryString = (
+ searchParams: URLSearchParams,
+ name: string,
+ value: string,
+): string => {
+ const params = new URLSearchParams(searchParams.toString())
+ params.set(name, value)
+
+ return params.toString()
+}