Skip to content

Commit

Permalink
item updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoestner committed Jan 21, 2024
1 parent b73efef commit 677cf01
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions integrations/plaid/server/db/queries/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,21 @@ const retrieveItemsByUser = async userId => {
*/
const updateItemStatus = async (itemId, status) => {
const query = {
text: 'UPDATE items SET status = $1 WHERE plaid_item_id = $2',
text: 'UPDATE items SET status = $1 WHERE id = $2',
values: [status, itemId],
};
await db.query(query);
};

/**
* Updates the transaction cursor for a single item.
*
* @param {string} itemId the Plaid item ID of the item.
* @param {string} plaidItemId the Plaid item ID of the item.
* @param {string} transactionsCursor latest observed transactions cursor on this item.
*/
const updateItemTransactionsCursor = async (itemId, transactionsCursor) => {
const updateItemTransactionsCursor = async (plaidItemId, transactionsCursor) => {
const query = {
text: 'UPDATE items SET transactions_cursor = $1 WHERE plaid_item_id = $2',
values: [transactionsCursor, itemId],
values: [transactionsCursor, plaidItemId],
};
await db.query(query);
};
Expand Down

0 comments on commit 677cf01

Please sign in to comment.