Skip to content

Commit

Permalink
Merge pull request #8 from ManojNathIC/services
Browse files Browse the repository at this point in the history
Task #215071 frontend cookie session issue fixed and added URL config file
  • Loading branch information
paritshivani authored Mar 6, 2024
2 parents 26f5d7b + 26dfd7c commit 146a91d
Show file tree
Hide file tree
Showing 3 changed files with 413 additions and 66 deletions.
13 changes: 8 additions & 5 deletions packages/common-lib/src/services/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@ import axios from 'axios'

export async function get(url: string, headers: any = {}) {
return await axios.get(url, {
headers
headers,
withCredentials: true // Include cookies in requests
})
}

export async function post(url: string, body: any, headers: any = {}) {
return await axios.post(url, body, {
headers
headers,
withCredentials: true // Include cookies in requests
})
}

export async function update(url: string, body: any, headers: any = {}) {
return await axios.put(url, body, {
headers
headers,
withCredentials: true // Include cookies in requests
})
}

export async function distory(url: string, body: any, headers: any = {}) {
return await axios.delete(url, {
...headers,
headers: { ...headers?.headers, 'Access-Control-Allow-Origin': '*' },
headers,
withCredentials: true, // Include cookies in requests
data: body
})
}
Loading

0 comments on commit 146a91d

Please sign in to comment.