Skip to content

Commit

Permalink
LSPS1: REST: change get_order to a GET call
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed May 6, 2024
1 parent 597cfcc commit d1ebb7e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions stores/LSPStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,21 +494,13 @@ export default class LSPStore {
@action
public getOrderREST(id: string) {
this.loading = true;
const data = JSON.stringify({
order_id: id
});
const endpoint = `${this.getLSPS1Rest()}/api/v1/get_order`;
const endpoint = `${this.getLSPS1Rest()}/api/v1/get_order?order_id=${id}`;

console.log('Sending data to:', endpoint);

return ReactNativeBlobUtil.fetch(
'POST',
endpoint,
{
'Content-Type': 'application/json'
},
data
)
return ReactNativeBlobUtil.fetch('GET', endpoint, {
'Content-Type': 'application/json'
})
.then((response) => {
const responseData = JSON.parse(response.data);
console.log('Response received:', responseData);
Expand Down

0 comments on commit d1ebb7e

Please sign in to comment.