You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🎯 Due April 12th, 2023
Taarika Bala, Siara Small, Alex Lee, Alyssa Williams
Your task for this week and a half is to add functionality to the AddSenior page, so that you can generate a new model and store it on submission of the form!
Specifically, you'll be writing the handleSubmit functions specified in add-senior.tsx. Don't worry about the event parameter passed in; you'll be using the properties in seniorData to construct a new model.
First, you'll want to retrieve a list of the current Students, represented by User models.add-senior.tsx has a dropdown of potential student names; so, replace the dropData parameter in the <AddProfile> with these names!
Then, build your newSenior model. You'll populate fields like name and location with the data passed into the handleSubmit() function. Other fields are more specific:StudentIDs and Students will describe all associated Users. A new Senior has no files. Furthermore, on creation of a new senior, you'll want to give them a unique folder in Google Drive...
Use the Google Drive API to create a new folder under the JumboCode gmail account. Use the code shown here in the Google Drive API, under Node.js, for reference on how to create a new folder: here. Save the file.data.id value: this is what you'll store in the Senior model's folder field, so that Senior's files can be retrieved later.
Finally, create and push your new model. You'll be using your function written in src/pages/api/senior/add.ts. Check out the handleSubmit() code snippet below from refine.dev on how to use your routes.
🎯 Due April 12th, 2023
Taarika Bala, Siara Small, Alex Lee, Alyssa Williams
Your task for this week and a half is to add functionality to the
AddSenior
page, so that you can generate a new model and store it on submission of the form!Specifically, you'll be writing the
handleSubmit
functions specified inadd-senior.tsx
. Don't worry about theevent
parameter passed in; you'll be using the properties inseniorData
to construct a new model.User
models.add-senior.tsx
has a dropdown of potential student names; so, replace thedropData
parameter in the<AddProfile>
with these names!Senior
model. You'll populate fields likename
andlocation
with the data passed into thehandleSubmit()
function. Other fields are more specific:StudentIDs
andStudents
will describe all associatedUser
s. A newSenior
has no files. Furthermore, on creation of a new senior, you'll want to give them a unique folder in Google Drive...file.data.id
value: this is what you'll store in theSenior
model'sfolder
field, so thatSenior
's files can be retrieved later.Finally, create and push your new model. You'll be using your function written in
src/pages/api/senior/add.ts
. Check out thehandleSubmit()
code snippet below from refine.dev on how to use your routes.We anticipate that the Google Drive part will be a little trickier– reach out to me or Michael if you have any questions.
The text was updated successfully, but these errors were encountered: