Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
ebcab5cd
Commit
ebcab5cd
authored
Jul 11, 2022
by
Lee SeoYeon
Browse files
.
parent
5cd5064a
Changes
4
Hide whitespace changes
Inline
Side-by-side
frontend/src/apis/survey.api.ts
View file @
ebcab5cd
...
...
@@ -6,9 +6,4 @@ export const createSurvey = async (survey:SurveyType) => {
console
.
log
(
survey
)
const
{
data
}
=
await
axios
.
post
(
`
${
baseUrl
}
/surveys/create`
,
{...
survey
})
return
data
;
}
// export const getSurvey = async () => {
// const {data} = await axios.get(`${baseUrl}/surveys/profile`)
// return data;
// }
\ No newline at end of file
}
\ No newline at end of file
src/controllers/survey.controller.ts
View file @
ebcab5cd
...
...
@@ -6,9 +6,4 @@ export const createSurvey = asyncWrap(async (req, res) => {
console
.
log
(
"
Survey body
"
,
survey
);
const
newSurvey
=
await
surveyDb
.
createSurvey
(
survey
);
return
res
.
json
(
newSurvey
);
});
// export const getSurveys = asyncWrap(async (req, res) => {
// const surveys = await surveyDb.getSurveys();
// return res.json(surveys);
// });
});
\ No newline at end of file
src/db/survey.db.ts
View file @
ebcab5cd
...
...
@@ -3,9 +3,4 @@ import { Survey, ISurvey } from "../models";
export
const
createSurvey
=
async
(
survey
:
ISurvey
)
=>
{
const
newSurvey
=
await
Survey
.
create
(
survey
);
return
newSurvey
;
};
// export const getSurveys = async () => {
// const surveys = await Survey.find({}).populate("questions")
// return surveys
// }
\ No newline at end of file
};
\ No newline at end of file
src/routes/survey.route.ts
View file @
ebcab5cd
...
...
@@ -7,7 +7,4 @@ router
.
route
(
"
/create
"
)
.
post
(
surveyCtrl
.
createSurvey
);
// router
// .route("/profile")
// .get(surveyCtrl.getSurveys)
export
default
router
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment