How to pass a list of strings from a function? I am calling an endpoint. for the time being, I will mock the API and return a list of strings. I got stuck here. can anyone help me?

mock.onGet('/patients/100/advanced-graphings').reply(200, {
  advancedGraphing: '[ "Graph 1" , "Graph 2" , "Graph 3" , "Graph 4" , "Graph 5" , "Graph 6" ]'
});

1 Answers

0
Qasim On

I think you should remove the single quotes from your advancedGraphing object value.

mock.onGet('/patients/100/advanced-graphings').reply(200, {
  advancedGraphing: [ "Graph 1" , "Graph 2" , "Graph 3" , "Graph 4" , "Graph 5" , "Graph 6" ]
});