From 3f583fae4b21335d3135b862d88b5886703d0019 Mon Sep 17 00:00:00 2001 From: Saul Burgess Date: Mon, 4 Dec 2023 13:22:40 +0000 Subject: [PATCH 1/2] Docker updates --- .dockerignore | 2 ++ Dockerfile | 2 +- package.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..25c8fdb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +package-lock.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cb363cd..eb9faee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:alpine as BUILD_IMAGE +FROM node:latest as BUILD_IMAGE WORKDIR /app diff --git a/package.json b/package.json index 84b9eed..a04cbaf 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "react": "latest", "react-dom": "latest", "react-redux": "^8.1.3", + "sharp": "^0.33.0", "tailwind-merge": "^1.14.0", "tailwindcss-animate": "^1.0.7", "yup": "^1.3.2" From 97efaf371f5d10ce61dc9d86b04e6ccfdc4676d6 Mon Sep 17 00:00:00 2001 From: Soyeon Lee <57412714+call203@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:59:22 +0000 Subject: [PATCH 2/2] fix/error (#38) --- src/components/apis/default.ts | 1 + src/components/user-dashboard/DataCards.tsx | 50 +++++++++++---------- src/components/user-dashboard/chatbox.tsx | 41 +++++++++-------- src/pages/provider-registration/index.tsx | 2 +- 4 files changed, 51 insertions(+), 43 deletions(-) diff --git a/src/components/apis/default.ts b/src/components/apis/default.ts index 9c293a3..4916ca6 100644 --- a/src/components/apis/default.ts +++ b/src/components/apis/default.ts @@ -36,6 +36,7 @@ export async function apiRequest({ method, path, body, header }: apiRequesProps) } else if (method === 'DELETE') { res = await customAxios.delete(path, body) } + console.log(res) return { status: res?.status || res?.data?.status, message: res?.data } } catch (error) { if (axios.isAxiosError(error)) { diff --git a/src/components/user-dashboard/DataCards.tsx b/src/components/user-dashboard/DataCards.tsx index 86642a4..9731033 100644 --- a/src/components/user-dashboard/DataCards.tsx +++ b/src/components/user-dashboard/DataCards.tsx @@ -8,6 +8,8 @@ import { } from '@/components/ui/card' import { TUserDashboardTable } from './columns' import { Button } from '../ui/button' +import { useSelector } from 'react-redux' +import { selectAuthState } from '@/store/authSlice' interface IProps { data: TUserDashboardTable[] @@ -17,7 +19,7 @@ interface IProps { } export default function DataCards({ data, userType, clickChat, handleClickInfoForChat }: IProps) { - console.log(userType) + const authState = useSelector(selectAuthState) return (
{data?.map((service: TUserDashboardTable, Index: number) => ( @@ -33,11 +35,25 @@ export default function DataCards({ data, userType, clickChat, handleClickInfoFo
  • Pricing: {service?.pricing}
  • - -
    - {userType === 'service_provider' ? ( - <> -
    + {authState && ( + +
    + {userType === 'service_provider' ? ( + <> +
    + + +
    + + ) : ( + <> - -
    - - ) : ( - <> - - - )} -
    - + + )} +
    +
    + )} ))}
    diff --git a/src/components/user-dashboard/chatbox.tsx b/src/components/user-dashboard/chatbox.tsx index 759f431..535fa38 100644 --- a/src/components/user-dashboard/chatbox.tsx +++ b/src/components/user-dashboard/chatbox.tsx @@ -7,6 +7,7 @@ import { Chat, selectChatListState, setChatListState } from '@/store/chatSlilce' import { selectUserId, selectUserType } from '@/store/userSlice' import { ChatUserList } from './chatUserList' import { TUserDashboardTable } from './columns' +import { selectAuthState } from '@/store/authSlice' export interface ChatBoxProps { handleChatBox: () => void @@ -16,6 +17,7 @@ export interface ChatBoxProps { const ChatBox = ({ handleChatBox, contactInfo }: ChatBoxProps) => { const chatlist = useSelector(selectChatListState) const userType = useSelector(selectUserType) + const authState = useSelector(selectAuthState) const userId = useSelector(selectUserId) const dispatch = useDispatch() @@ -36,7 +38,7 @@ const ChatBox = ({ handleChatBox, contactInfo }: ChatBoxProps) => { Number(item.user_id) === userId : Number(item.provider_id) === userId, ) - + console.log(messages) dispatch(setChatListState(messages)) if (userType === 'service_provider') { const reverseArray = res.message.reverse() @@ -60,7 +62,6 @@ const ChatBox = ({ handleChatBox, contactInfo }: ChatBoxProps) => { const handleMessageChange = (event: React.ChangeEvent) => { setMessage(event.target.value) } - const handlePressSend = () => { const chatform = { user_id: userType === 'user' ? userId : userIdFromList, @@ -143,23 +144,25 @@ const ChatBox = ({ handleChatBox, contactInfo }: ChatBoxProps) => { })} -
    - - -
    + {authState && ( +
    + + +
    + )} )} diff --git a/src/pages/provider-registration/index.tsx b/src/pages/provider-registration/index.tsx index bbd83ef..daf6c8e 100644 --- a/src/pages/provider-registration/index.tsx +++ b/src/pages/provider-registration/index.tsx @@ -124,7 +124,7 @@ const Index: FC = () => { date_created: new Date(), }, }).then(res => { - if (res?.status === 200) { + if (res?.status === 201) { const service_id = res?.message if (profileImg) { apiRequest({