Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeesun Kim authored and jeesunikim committed Jul 29, 2024
1 parent 0f6ec8e commit 8292fb6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/app/(sidebar)/endpoints/[[...pages]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ export default function Endpoints() {
return {
...defaultRpcRequestBody,
params: {
startLedger: params.ledger ?? "",
cursor: params.cursor,
limit: params.limit,
startLedger: Number(params.ledger),
pagination: {
cursor: params.cursor,
limit: Number(params.limit) || undefined,
},
filters: [
{
type: filteredParams.type ?? "",
Expand Down Expand Up @@ -177,9 +179,11 @@ export default function Endpoints() {
return {
...defaultRpcRequestBody,
params: {
startLedger: params.ledger ?? "",
cursor: params.cursor,
limit: params.limit,
startLedger: Number(params.ledger),
pagination: {
cursor: params.cursor,
limit: Number(params.limit) || undefined,
},
},
};
}
Expand Down Expand Up @@ -262,7 +266,7 @@ export default function Endpoints() {
isValidReqFields = missingReqFields.length === 0;

// Checking if there are any errors
isValid = formError.tx?.result === "success" || isEmptyObject(formError);
isValid = isEmptyObject(formError);

// Asset components
const assetParams = [
Expand Down Expand Up @@ -556,6 +560,7 @@ export default function Endpoints() {
const requiredParams = renderedProps.params
? Object.values(renderedProps.params).filter((val) => val !== undefined)
: undefined;

const rows = requiredParams
? requiredParams.length + defaultRowsLength + 2
: defaultRowsLength;
Expand Down Expand Up @@ -703,7 +708,7 @@ export default function Endpoints() {

const error = component.validate?.(value, isRequired);

if (error) {
if (error && error.result !== "success") {
setFormError({ ...formError, [f]: error });
} else if (formError[f]) {
const updatedErrors = { ...formError };
Expand Down

0 comments on commit 8292fb6

Please sign in to comment.