-
Notifications
You must be signed in to change notification settings - Fork 1
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
Estimating backend #19
base: master
Are you sure you want to change the base?
Conversation
72666e9
to
5936af8
Compare
763feea
to
658277f
Compare
658277f
to
c36115a
Compare
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.
Some minor things and conflicts.
server/app/models/project.rb
Outdated
|
||
def self.join_user_project(user:, project:) | ||
p = Project.find_by(id: project.id) | ||
p = Project.create!(id: project.id) if p.nil? |
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.
find_or_create_by
. I think this would move the need for this method entirely:
user.projects << Project.find_or_create_by(id: project.id)
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.
Yeah I don't think this method is used at all... so I will just get rid of it. We do this instead:
pr = Project.find_or_initialize_by(id: p.id)
pr.name = p.name
pr.save!
self.projects << pr
where self
is a User
server/app/models/story.rb
Outdated
end | ||
|
||
est | ||
else { message: 'Invalid point value for this project\'s schema' } |
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.
Nit: move the object return to a line beneath else
} | ||
|
||
const EstimateSelect = ({ projectId, storyId }: Props) => { | ||
const state = useStore().getState(); |
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.
Does this actually update on state changes? I thought we needed useSelector
for a different issue.
if (res.fetching) { | ||
return <>Loading GraphQL...</>; | ||
} else if (res.error) { | ||
console.log(res.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.
console.error
and you'll need a tslint.disable-next-line no-console
comment.
c36115a
to
bca5934
Compare
bca5934
to
349cfb7
Compare
DNM until base branch #14 is mergedThings to fix:
Estimate
is not invalidated by URQL from the beginning, so once something appears there it does not know how to handle it. But this might not be the problem, because I tried reloading the page when the database is populated and nothing was shown either.