Skip to content

Commit

Permalink
fix: entity scaffold url path (#1293)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 authored Sep 4, 2024
1 parent b4d546d commit 791f91d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/EntityScaffold.res
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ let make = (
} else {
switch remainingPath {
| list{"new"} => renderNewForm()
| list{id, key} => renderShow(id, key)
| list{id} => renderShow(id, None)
| list{id, key} => renderShow(id, Some(key))
| list{} => renderList()
| _ => <NotFoundPage />
}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Disputes/ShowDisputes.res
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ let make = (~id, ~profileId) => {
try {
setScreenState(_ => PageLoaderWrapper.Loading)
let disputesUrl = getURL(~entityName=DISPUTES, ~methodType=Get, ~id=Some(id))
let _ = await internalSwitch(~expectedProfileId=Some(profileId))
let _ = await internalSwitch(~expectedProfileId=profileId)
let response = await fetchDetails(disputesUrl)
setDisputeData(_ => response)
setScreenState(_ => PageLoaderWrapper.Success)
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Order/ShowOrder.res
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ let make = (~id, ~profileId) => {
let fetchOrderDetails = async url => {
try {
setScreenState(_ => Loading)
let _ = await internalSwitch(~expectedProfileId=Some(profileId))
let _ = await internalSwitch(~expectedProfileId=profileId)
let res = await fetchDetails(url)
let order = OrderEntity.itemToObjMapper(res->getDictFromJsonObject)
setOrderData(_ => order)
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Payouts/ShowPayout.res
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ let make = (~id, ~profileId) => {
try {
setScreenState(_ => PageLoaderWrapper.Loading)
let payoutsUrl = getURL(~entityName=PAYOUTS, ~methodType=Get, ~id=Some(id))
let _ = await internalSwitch(~expectedProfileId=Some(profileId))
let _ = await internalSwitch(~expectedProfileId=profileId)
let response = await fetchDetails(payoutsUrl)
setPayoutsData(_ => response)
setScreenState(_ => PageLoaderWrapper.Success)
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Refunds/ShowRefund.res
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let make = (~id, ~profileId) => {
let fetchRefundData = async () => {
try {
let refundUrl = getURL(~entityName=REFUNDS, ~methodType=Get, ~id=Some(id))
let _ = await internalSwitch(~expectedProfileId=Some(profileId))
let _ = await internalSwitch(~expectedProfileId=profileId)
let refundData = await fetchDetails(refundUrl)
let paymentId =
refundData->LogicUtils.getDictFromJsonObject->LogicUtils.getString("payment_id", "")
Expand Down

0 comments on commit 791f91d

Please sign in to comment.