kir-dev / schbody

https://body.sch.bme.hu
1 stars 0 forks source link

Feat/application form #49

Closed FearsomeRover closed 2 months ago

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
schbody-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 1, 2024 2:57pm
FearsomeRover commented 2 months ago

Yea, we need to think about what the correct order of business here is. I think first we need to update the profile data, and if it is successful onl then post the application. Also do we need to have some sort of confirmation when the users room hasn't changed? Or do they only need to check the rules checkbox then? On 31 Aug 2024, 20:47 +0200, Mozsár Máté @.***>, wrote:

@mozsarmate commented on this pull request. In apps/frontend/src/components/ui/ApplicationForm.tsx:

 try {
  • const response = await axios.post('/api/application', values);
  • if (response.status === 200) {
  • const updateResponse = await api.patch('/users/me', values);
  • const response = await api.post('/application', { the user is able to send their application even if they fail to update their data? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
mozsarmate commented 2 months ago

Yeah, i agree on this, although your code does not check whether the profile data update was successful or not. I don't think we would need another checkbox, would say that the opportunity to change your room number is quite clear.

FearsomeRover commented 2 months ago

Yeah, i agree on this, although your code does not check whether the profile data update was successful or not. I don't think we would need another checkbox, would say that the opportunity to change your room number is quite clear.

Well axios throws error, if the response status is 4-500 so the application wont be submitted.