phx-react
Version:
PHX REACT
54 lines (52 loc) • 1.46 kB
JavaScript
export const returnBorrowBookMutation = `
mutation returnBorrowBookMutation(
$inWarehouseIdArray: [Int!]!
$inBookshelfIdArray: [Int!]!
$borrowBookIdArray: [Int!]!
$inWarehouseStateId: Int!
$inBookshelfStateId: Int!
) {
moveBookToWarehouse: update_library_dang_ki_ca_biet(
where: { id: { _in: $inWarehouseIdArray }}
_set: {state_id: $inWarehouseStateId, updated_at: now}
) {
affected_rows
}
moveBookToBookshelf: update_library_dang_ki_ca_biet(
where: { id: { _in: $inBookshelfIdArray }}
_set: {state_id: $inBookshelfStateId, updated_at: now }
) {
affected_rows
}
updateBorrowBook: update_library_borrow_book(
where: {
id: {_in: $borrowBookIdArray}
}
_set: {return_date: now, updated_at: now}
) {
affected_rows
}
}
`;
export const getTicketStateListQuery = `
query getTicketStateListQuery($school_id: Int!) {
library_ticket_state(
where: {deleted_at: {_is_null: true}, school_id: {_eq: $school_id}}
) {
name
id
code
}
}
`;
export const returnBorrowTicketMutation = `
mutation returnBorrowTicketMutation($idArray: [Int!]!, $returnStateId: Int!) {
update_library_borrow_ticket(
where: {id: {_in: $idArray}}
_set: {updated_at: now, ticket_state_id: $returnStateId, actual_return_date: now }
) {
affected_rows
}
}
`;
//# sourceMappingURL=mutation.js.map