Commit eeb9a28a authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

survey보는 페이지 이동버튼

parent a47b2cf2
...@@ -17,7 +17,7 @@ export const SurveyRouter = () => { ...@@ -17,7 +17,7 @@ export const SurveyRouter = () => {
<Route path="login" element={<Login />} /> <Route path="login" element={<Login />} />
<Route path="signup" element={<SignUp />} /> <Route path="signup" element={<SignUp />} />
<Route path="surveys/edit/:surveyId" element={<EditSurvey />} /> <Route path="surveys/edit/:surveyId" element={<EditSurvey />} />
<Route path="survey" element={<SurveyForm />} /> <Route path="surveys/:surveyId" element={<SurveyForm />} />
<Route <Route
path="profile" path="profile"
element={ element={
......
...@@ -20,6 +20,12 @@ export const MySurveyCard = ({ data }: Props) => { ...@@ -20,6 +20,12 @@ export const MySurveyCard = ({ data }: Props) => {
}); });
}; };
const goSurvey = () => {
navigate(`/surveys/${data._id}`, {
replace: true,
});
};
async function deleteSurvey() { async function deleteSurvey() {
try { try {
if (data._id) { if (data._id) {
...@@ -47,9 +53,11 @@ export const MySurveyCard = ({ data }: Props) => { ...@@ -47,9 +53,11 @@ export const MySurveyCard = ({ data }: Props) => {
</div> </div>
<div className="flex flex-col px-5 py-3"> <div className="flex flex-col px-5 py-3">
<div className="h-12"> <div className="h-12">
<p className="font-bold"> <button type="button" onClick={goSurvey}>
{data.title ? data.title : "제목없는 설문조사"} <p className="font-bold">
</p> {data.title ? data.title : "제목없는 설문조사"}
</p>
</button>
<p className="text-gray-500 text-sm"> <p className="text-gray-500 text-sm">
{data.updatedAt?.substring(0, 10)} {data.updatedAt?.substring(0, 10)}
</p> </p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment