Skip to content

Commit

Permalink
Merge pull request #35 from buildingu/chore-fix-feedbackrequestform
Browse files Browse the repository at this point in the history
Patch-fix-Feedback-Request-Form
  • Loading branch information
gbudjeakp authored Jul 8, 2024
2 parents 15d362f + e4361ec commit d1a5ec7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
1 change: 0 additions & 1 deletion Controllers/feedbackController.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const submitFeedBack = async (req, res) => {
await exerciseInfo.create(add_User_To_ExerciseInfo_Table);
await FeedbackRequest.create(feedBackRequestData);
studentNotification(feedBackRequestData);

}

res.status(200).json({ data: feedBackRequestData });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "building-u-feedback-api",
"version": "v0.4.2-alpha",
"version": "v0.4.4-alpha",
"description": "This is for the server api that serves the app",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion views/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "building-u-feedback",
"version": "v0.2.1-alpha",
"version": "v0.2.2-alpha",
"homepage": "https://buildingu.github.io/Building-u-feedback",
"type": "module",
"scripts": {
Expand Down
15 changes: 3 additions & 12 deletions views/src/Pages/FeedbackrequestForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ function FeedbackRequestForm() {
const [opened, { open, close }] = useDisclosure(false);

const form = useForm({
initialValues: { name: "", topicOfLearningSession: null, codeLink: "" },
initialValues: { topicOfLearningSession: null, codeLink: "" },
validate: {
name: (value) =>
value.length < 3 ? "Name must have at least 3 letters" : null,
topicOfLearningSession: (value) =>
topics.some((item) => value?.includes(item))
? null
Expand All @@ -74,10 +72,11 @@ function FeedbackRequestForm() {
const handleSubmitRequest = () => {
dispatch(createFeedbackRequest(form.values));
dispatch(fetchFeedbackRequests());

if (loading === "succeeded"){
open()
}
form.setValues({ name: "", topicOfLearningSession: null, codeLink: "" });
form.setValues({ topicOfLearningSession: null, codeLink: "" });
};

return (
Expand All @@ -100,14 +99,6 @@ function FeedbackRequestForm() {
Request Feedback
</Text>
<div style={formStyle}>
<TextInput
variant="filled"
style={inputStyle}
id="internName"
label="Intern Name"
placeholder="Enter intern's name"
{...form.getInputProps("name")}
/>
<Select
label="Topic of Learning Session"
placeholder="Select the topic of the learning session"
Expand Down
4 changes: 2 additions & 2 deletions views/src/features/Feedbacks/feedbackSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const createAsyncThunkWithJwt = (type, url, method = "get") =>

const createFeedbackRequest = createAsyncThunkWithJwt(
"feedback/create",
`${baseUrl}/api/feedback/submitfeedback",
"post`
`${baseUrl}/api/feedback/submitfeedback`,
"post"
);

const addFeedback = createAsyncThunkWithJwt(
Expand Down

0 comments on commit d1a5ec7

Please sign in to comment.