-
Notifications
You must be signed in to change notification settings - Fork 0
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
158 show edit projects #196
base: main
Are you sure you want to change the base?
Conversation
The cancel is not working
Save original data to cancel. still needs work
} | ||
|
||
// Update | ||
put("/projects/{projectId}") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused route parameter
get("/projects") { | ||
val userId = call.getUserId() | ||
if (userId == null) { | ||
if (userId == null) { // Check if it's admin to return all the projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment seems out of place
val projectId = UUID.fromString(call.parameters["projectId"]) | ||
|
||
val userId = call.getUserId() | ||
if (userId == null) { // Check if the user have access to the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment seems out of place
export async function getProjectById(projectId: string): Promise<Project | null> { | ||
try { | ||
return await ztorFetch(`/projects/${projectId}`); | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should catch these errors. Later we can make an error boundary in React to display it nicer.
} else { | ||
setIsEditing(true); | ||
} | ||
}, [projectId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably easier to put this in a route loader
No description provided.