MorganBergen / clarity

Advanced ML for Nutritional Analysis and Healthcare Management
1 stars 0 forks source link

Fetch and display questionnaire data #14

Open MorganBergen opened 10 hours ago

MorganBergen commented 10 hours ago

General Steps

  1. fetch questionnaire data - make sure that the questionnaire data is stored in a way that can be retrieved using the user id and store the data in a separate collection in pocketbase

  2. display the data - update the Settings.js component to fetch and display the questionnaire data.

MorganBergen commented 10 hours ago

Currently from commit f32e12d..22aaade I am receiving a console log error

pocketbaseService.js:46

Failed to load resource: the server responded with a status of 403
http://127.0.0.1:8090/api/collections/questionnaire/records
(Forbidden)

index.js:13 and Questionnaire.js:65

[Error] Error saving questionnaire data:
ClientResponseError 403: Only admins can perform this action.
    (anonymous function) (bundle.js:4618)
    (anonymous function) (bundle.js:1674)

    (anonymous function) index.js:13
    (anonymous function) Questionnaire.js:65

index.js:13 from try catch block

Error fetching user data:
TypeError: pb.collection('questionnaire').getFullListItem is not a function. (In 'pb.collection('questionnaire').getFullListItem(`user_id="${userId}"`)', 'pb.collection('questionnaire').getFullListItem' is undefined)
    (anonymous function) index.js:13
    (anonymous function) Settings.js:65