Skip to content

Item checkin not returning any response #5

@otuoma

Description

@otuoma

It seems there is an issue with item checkin. I have the following code in express

router.get('/checkin',  async (req: Request, res: Response) => {

   const item_barcode: string = `${req.query.item_barcode}`;

   if (!item_barcode) {
       return res.status(400).send("Item barcode is required");
   }
   const sipTwo = new SipTwo(sip2ConnectionOptions);
   // sipTwo.setPatron({
   //     patronIdentifier: "123456",
   //     password: "demopass"
   // });
   try {
       await sipTwo.login();
       let datetime_now = new Date(); //getFormattedDated();
       let checkinRequestDto: ICheckinRequestDto = {
           location: sip2ConnectionOptions.institutionId,
           offline: false,
           returnDate: datetime_now,
           itemIdentifier: item_barcode
       };
       const checkinResponse: ICheckinResponse = await sipTwo.requestCheckin(checkinRequestDto);
       sipTwo.connection.close();
       res.status(200).send(checkinResponse);
   } catch (e) {
       console.log(e);
       sipTwo.connection.close();
       res.status(500).send("Error: Internal Server Error");
   }
});

There is no response from the server, ever.

However, if a non-existing item identifier is provided, then we get Invalid Item response, which is expected.

I tested with the sip-testing-tool on the same sip server and was able to check-in the same item.

There could be an awaitable that is not being awaited and I have not been able to fix it. @jblyberg

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions