OrderActivity orderActivity = new OrderActivity();
CustomerActivity customerActivity = new CustomerActivity();
// If they're authorized, return the results
String customerId = customerActivity.authenticate(username, password);
if (customerId != null) {
return Response.ok(orderActivity.addBookToOrder(customerId, bookId)).build();
}
return Response.status(Status.UNAUTHORIZED).build();
}
@DELETE