Skip to content

Commit

Permalink
test: create lease function splited
Browse files Browse the repository at this point in the history
  • Loading branch information
luifermoron committed Mar 21, 2024
1 parent f18d51b commit d23f300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/useCases/LeaseContractUseCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default class LeaseContractUseCases extends AbstractUseCases<
async generateTasks(
unknownObj: Record<string, unknown>
): Promise<NewLeaseContract> {
const { id } = unknownObj;
let lease = await this.findById(id as string, []);
const { _id } = unknownObj;
let lease = await this.findById(_id as string, []);
const generateEvents = false;
lease = await this.generateMonthlyRecurringTasks(lease, generateEvents);

Expand Down
10 changes: 4 additions & 6 deletions pages/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,16 @@ const Main: NextPage<NewPropertyProps> = (props: NewPropertyProps) => {
const router = useRouter();

useEffect(() => {
/* async function onSucessTasks(response: Response) {
async function onSucessTasks(response: Response) {
const data = await response.json();
const url = data.url as string;
router.push(url || '/');
} */
}

async function onSuccessCreate(response: Response) {
const data = await response.json();
console.log('loggin!!'); /* eslint-disable-line*/
console.log(data); /* eslint-disable-line*/
// const url = data.url as string;
// router.push(url || '/');
const { createTasksCallback } = leaseCalls;
await createTasksCallback(data, onSucessTasks);
}

async function create() {
Expand Down

0 comments on commit d23f300

Please sign in to comment.