Skip to content

Commit

Permalink
Delete dead code. Fixes #770
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeHiro committed Aug 10, 2018
1 parent 746fac9 commit 4ded05e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 38 deletions.
8 changes: 0 additions & 8 deletions client/store/backend.js
Expand Up @@ -92,20 +92,12 @@ export function init() {
});
}

export function getAccounts(accessId) {
return buildFetchPromise(`api/${API_VERSION}/accesses/${accessId}/accounts`);
}

export function deleteAccess(accessId) {
return buildFetchPromise(`api/${API_VERSION}/accesses/${accessId}`, {
method: 'DELETE'
});
}

export function getOperations(accountId) {
return buildFetchPromise(`api/${API_VERSION}/accounts/${accountId}/operations`);
}

export function deleteOperation(opId) {
return buildFetchPromise(`api/${API_VERSION}/operations/${opId}`, {
method: 'DELETE'
Expand Down
10 changes: 0 additions & 10 deletions server/controllers/v1/accesses.js
Expand Up @@ -24,16 +24,6 @@ export async function preloadAccess(req, res, next, accessId) {
}
}

// Returns accounts bound to a given access.
export async function getAccounts(req, res) {
try {
let accounts = await Account.byAccess(req.preloaded.access);
res.status(200).json(accounts);
} catch (err) {
return asyncErr(err, res, 'when getting accounts for a bank');
}
}

// Destroy a given access, including accounts, alerts and operations.
export async function destroy(req, res) {
try {
Expand Down
11 changes: 0 additions & 11 deletions server/controllers/v1/accounts.js
Expand Up @@ -84,17 +84,6 @@ export async function destroy(req, res) {
}
}

// Get operations of a given bank account
export async function getOperations(req, res) {
try {
let account = req.preloaded.account;
let operations = await Operation.byBankSortedByDate(account);
res.status(200).json(operations);
} catch (err) {
return asyncErr(res, err, 'when getting operations for a bank account');
}
}

export async function resyncBalance(req, res) {
try {
let account = req.preloaded.account;
Expand Down
6 changes: 0 additions & 6 deletions server/controllers/v1/routes.js
Expand Up @@ -33,9 +33,6 @@ const routes = {
put: accesses.update,
delete: accesses.destroy
},
'accesses/:accessId/accounts': {
get: accesses.getAccounts
},
'accesses/:accessId/fetch/operations': {
get: accesses.fetchOperations
},
Expand All @@ -51,9 +48,6 @@ const routes = {
put: accounts.update,
delete: accounts.destroy
},
'accounts/:accountId/operations': {
get: accounts.getOperations
},
'accounts/:accountId/resync-balance': {
get: accounts.resyncBalance
},
Expand Down
4 changes: 1 addition & 3 deletions server/models/requests.js
Expand Up @@ -12,7 +12,6 @@ function allReportsByFrequency() { emit([doc.type, doc.frequency], doc); }
function allByBankAccountAndType() { emit([doc.accountId, doc.type], doc); }
function allByBankAccountAndDate() { emit([doc.accountId, doc.date], doc); }
function allAccessesLike() { emit([doc.bank, doc.login, doc.password], doc); }
function allAccountsLike() { emit([doc.bank, doc.accountNumber], doc); }
function allOperationsLike() { emit([doc.accountId, doc.date, doc.amount.toFixed(2), doc.raw], doc); }
function allWithOperationTypesId() { if (doc.hasOwnProperty('operationTypeID')) { emit(doc._id, doc); } }
/* eslint-enable */
Expand All @@ -33,8 +32,7 @@ module.exports = {
all: cozydb.defaultRequests.all,
allByAccountIds,
allByBankAccess,
allByBank,
allLike: allAccountsLike
allByBank
},

operation: {
Expand Down

0 comments on commit 4ded05e

Please sign in to comment.