0

I have a query param that starts with xyz:// and as soon as I launch the query I get this error:

{  "status": "FETCH_ERROR",  "error": "TypeError: Network request failed"}

Here's my endpoint code:

    ...

    getHealthRecords: builder.query<any, GetHealthRecordsArgs>({
          keepUnusedDataFor: 0,
          query: ({facilityId}) => {
            return {
              url: `health-record/${facilityId}`,
              params: {residentUri: 'xyz://'},
            };
          },
        }),

    ...

It seems like RTK Query doesn't account for this and it breaks the request's url, how can I resolve this issue?

abdou-tech
  • 687
  • 1
  • 8
  • 16
  • Try using escapes: 'xyz:\/\/' or even 'xyz\:\/\/' or a URLencoded string – Abe Aug 02 '23 at 05:31
  • @Abe Yes that's what I did I used an encoded url, for future reference see https://www.w3schools.com/tags/ref_urlencode.asp – abdou-tech Aug 02 '23 at 08:17

0 Answers0