Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate project #68

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/src/assets/HuskyGreeting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/HuskyRating.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
626 changes: 626 additions & 0 deletions client/src/index.css

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions client/src/pages/CreateProj.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type FormState = {
title: string;
description: string;
location: string;
maxMems: string;
maxMems: number;
startDate: string;
image: Blob | null | string;
};
Expand All @@ -25,7 +25,7 @@ export default function CreateProj() {
title: '',
description: '',
location: '',
maxMems: '',
maxMems: 0,
image: null,
startDate: '',
}); // state form the inputs
Expand Down Expand Up @@ -55,12 +55,16 @@ export default function CreateProj() {
mutationFn: (image: Blob) => uploadProjectImage(image),
onSuccess(url) {
if (!user) return;
if (Number.isNaN(formState.maxMems)) {
return;
}
projMutation.mutate({
name: formState.title,
description: formState.description,
meetLocation: formState.location,
meetType: '',
ownerId: user?.id,
maxMems: formState.maxMems,
imageUrl: url,
startDate: formState.startDate,
tags: addedTags,
Expand Down Expand Up @@ -267,7 +271,7 @@ export function InputsView({
max={100}
placeholder="5"
onChange={(e) =>
setFormState({ ...formState, maxMems: e.target.value })
setFormState({ ...formState, maxMems: Number(e.target.value)})
}
value={formState.maxMems}
required
Expand Down
Loading
Loading