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

158 show edit projects #196

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

158 show edit projects #196

wants to merge 7 commits into from

Conversation

macano
Copy link
Contributor

@macano macano commented Dec 18, 2024

No description provided.

@macano macano temporarily deployed to swarm-pullrequest December 18, 2024 11:40 — with GitHub Actions Inactive
}

// Update
put("/projects/{projectId}") {
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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) {
Copy link
Member

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]);
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants