queryfix
This commit is contained in:
@@ -71,8 +71,7 @@ export default function EndpointCard({ endpoint, baseUrl, isLegacy, onSend, resu
|
|||||||
}, [path, paramDefs, values, baseUrl])
|
}, [path, paramDefs, values, baseUrl])
|
||||||
|
|
||||||
const handleSend = () => {
|
const handleSend = () => {
|
||||||
const useGraphql = endpoint.useGraphql || gqlKey === 'getinvoiceinsight' || gqlKey === 'getinvoices'
|
if (isLegacy && meta) {
|
||||||
if (isLegacy && meta && (endpoint.method !== 'GET' || useGraphql)) {
|
|
||||||
const graphqlUrl = `${baseUrl}/v1/graphql`
|
const graphqlUrl = `${baseUrl}/v1/graphql`
|
||||||
let parsedVars = {}
|
let parsedVars = {}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -84,9 +84,9 @@ export const graphqlMeta = {
|
|||||||
getusers: {
|
getusers: {
|
||||||
query: /* GraphQL */ `
|
query: /* GraphQL */ `
|
||||||
query GetUsers {
|
query GetUsers {
|
||||||
app_user {
|
app_users {
|
||||||
userid
|
userid
|
||||||
username
|
username: authname
|
||||||
email
|
email
|
||||||
contactno
|
contactno
|
||||||
status
|
status
|
||||||
@@ -839,6 +839,140 @@ export const graphqlMeta = {
|
|||||||
`,
|
`,
|
||||||
variables: `{}`,
|
variables: `{}`,
|
||||||
},
|
},
|
||||||
|
getdeliveries: {
|
||||||
|
query: /* GraphQL */ `
|
||||||
|
query GetDeliveries(
|
||||||
|
$tenantid: bigint!
|
||||||
|
$status: String
|
||||||
|
$fromdate: timestamp
|
||||||
|
$todate: timestamp
|
||||||
|
$keyword: String
|
||||||
|
$limit: Int
|
||||||
|
$offset: Int
|
||||||
|
) {
|
||||||
|
deliveries(
|
||||||
|
where: {
|
||||||
|
tenantid: { _eq: $tenantid }
|
||||||
|
_and: [
|
||||||
|
{ orderstatus: { _eq: $status } }
|
||||||
|
{ deliverydate: { _gte: $fromdate } }
|
||||||
|
{ deliverydate: { _lte: $todate } }
|
||||||
|
{
|
||||||
|
_or: [
|
||||||
|
{ pickupcustomer: { _ilike: $keyword } }
|
||||||
|
{ deliverycustomer: { _ilike: $keyword } }
|
||||||
|
{ pickupcontactno: { _ilike: $keyword } }
|
||||||
|
{ deliverycontactno: { _ilike: $keyword } }
|
||||||
|
{ orderid: { _ilike: $keyword } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
limit: $limit
|
||||||
|
offset: $offset
|
||||||
|
order_by: { deliveryid: desc }
|
||||||
|
) {
|
||||||
|
deliveryid
|
||||||
|
orderid
|
||||||
|
deliverydate
|
||||||
|
orderstatus
|
||||||
|
pickupcustomer
|
||||||
|
pickupcontactno
|
||||||
|
pickupaddress
|
||||||
|
deliverycustomer
|
||||||
|
deliverycontactno
|
||||||
|
deliveryaddress
|
||||||
|
kms
|
||||||
|
customers {
|
||||||
|
customertoken
|
||||||
|
}
|
||||||
|
app_users {
|
||||||
|
firstname
|
||||||
|
contactno
|
||||||
|
}
|
||||||
|
tenants {
|
||||||
|
tenantname
|
||||||
|
primarycontact
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables: `{\n "tenantid": 10,\n "status": "Delivered",\n "fromdate": "2026-05-01T00:00:00",\n "todate": "2026-05-05T23:59:59",\n "keyword": "%john%",\n "limit": 10,\n "offset": 0\n}`,
|
||||||
|
},
|
||||||
|
getpricinglist: {
|
||||||
|
query: /* GraphQL */ `
|
||||||
|
query GetPricingList($tenantid: bigint!) {
|
||||||
|
tenantpricing(where: { tenantid: { _eq: $tenantid } }) {
|
||||||
|
tenantpricingid
|
||||||
|
pricingid
|
||||||
|
tenantid
|
||||||
|
pricingtypeid
|
||||||
|
baseprice
|
||||||
|
priceperkm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables: `{\n "tenantid": 1087\n}`,
|
||||||
|
},
|
||||||
|
getallpricing: {
|
||||||
|
query: /* GraphQL */ `
|
||||||
|
query GetAllPricing($applocationid: bigint!) {
|
||||||
|
app_pricing(where: { applocationid: { _eq: $applocationid } }) {
|
||||||
|
pricingid
|
||||||
|
applocationid
|
||||||
|
pricingtypeid
|
||||||
|
baseprice
|
||||||
|
priceperkm
|
||||||
|
status
|
||||||
|
configid
|
||||||
|
minkm
|
||||||
|
maxkm
|
||||||
|
minorder
|
||||||
|
othercharges
|
||||||
|
slab
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables: `{\n "applocationid": 1\n}`,
|
||||||
|
},
|
||||||
|
getriderdetail: {
|
||||||
|
query: /* GraphQL */ `
|
||||||
|
query GetRiderDetail($userid: bigint!) {
|
||||||
|
app_users(where: { userid: { _eq: $userid } }) {
|
||||||
|
userid
|
||||||
|
authname
|
||||||
|
firstname
|
||||||
|
lastname
|
||||||
|
email
|
||||||
|
contactno
|
||||||
|
status
|
||||||
|
roleid
|
||||||
|
partnerid
|
||||||
|
applocationid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables: `{\n "userid": 1\n}`,
|
||||||
|
},
|
||||||
|
getallriders: {
|
||||||
|
query: /* GraphQL */ `
|
||||||
|
query GetAllRiders($partnerid: bigint!, $limit: Int) {
|
||||||
|
app_users(where: { partnerid: { _eq: $partnerid } }, limit: $limit) {
|
||||||
|
userid
|
||||||
|
authname
|
||||||
|
firstname
|
||||||
|
lastname
|
||||||
|
email
|
||||||
|
contactno
|
||||||
|
status
|
||||||
|
roleid
|
||||||
|
partnerid
|
||||||
|
applocationid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
variables: `{\n "partnerid": 44,\n "limit": 10\n}`,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getGraphQLKey(endpointName) {
|
export function getGraphQLKey(endpointName) {
|
||||||
@@ -855,13 +989,14 @@ export function getGraphQLKey(endpointName) {
|
|||||||
'getalltenants': 'gettenantinfo',
|
'getalltenants': 'gettenantinfo',
|
||||||
'gettenants': 'gettenantinfo',
|
'gettenants': 'gettenantinfo',
|
||||||
'gettenantsummary': 'getordersummary',
|
'gettenantsummary': 'getordersummary',
|
||||||
'getpricinglist': 'getallpricing',
|
|
||||||
'tenantsearch': 'searchcustomers',
|
'tenantsearch': 'searchcustomers',
|
||||||
'getallriders': 'getriderdetail',
|
|
||||||
'getallridersummary': 'getridershifts',
|
'getallridersummary': 'getridershifts',
|
||||||
'getorderdetails': 'getorders',
|
'getorderdetails': 'getorders',
|
||||||
'getlocationsummary': 'gettenantlocations',
|
'getlocationsummary': 'gettenantlocations',
|
||||||
'getpaymentrequest': 'getinvoices'
|
'getpaymentrequest': 'getinvoices',
|
||||||
|
'getapppricing': 'getallpricing',
|
||||||
|
'getriderpricing': 'getallpricing',
|
||||||
|
'getapplocationconfig': 'getlocationsconfig'
|
||||||
};
|
};
|
||||||
|
|
||||||
return map[name] || name;
|
return map[name] || name;
|
||||||
|
|||||||
Reference in New Issue
Block a user