Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2606/mecr #1292

Merged
merged 9 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions functions/actions/exercises/getMultipleApplicationData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export default (config, firebase, db, auth) => {

const getApplicationData = initGetApplicationData(config, firebase, db, auth);

return getMultipleApplicationData;

return getMultipleApplicationData;
async function getMultipleApplicationData(exerciseIds, columns) {
const allData = [];

Expand All @@ -23,5 +22,4 @@ export default (config, firebase, db, auth) => {

return allData;
}

};
1 change: 1 addition & 0 deletions functions/callableFunctions/getMultipleApplicationData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default functions.runWith(runtimeOptions).region('europe-west2').https.on
}, data)) {
throw new functions.https.HttpsError('invalid-argument', 'Please provide valid arguments');
}

return getMultipleApplicationData(data.exerciseIds, data.columns);

});
Expand Down
7 changes: 2 additions & 5 deletions nodeScripts/getMultipleApplicationData.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ const getMultipleApplicationData = initGetMultipleApplicationData(config, fireba
const exerciseIds = ['XvzIg48K9XOhfeFr3w91', 'Biyjd07Xz2usL9yXjtjV', 'IKLcf2Y187f2WTjifsoj'];

// Params for each call to getApplicationData
const params = {
columns: ['exerciseRef','referenceNumber','personalDetails.fullName','status'],
whereClauses: [],
};
const columns = ['exerciseRef','referenceNumber','personalDetails.fullName','status'];

const main = async () => {
return getMultipleApplicationData(exerciseIds, params);
return getMultipleApplicationData(exerciseIds, columns);
};

main()
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions test/functions/getMultipleApplicationData.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ describe('getMultipleApplicationData', () => {
context('Functionality', () => {
it('should return data for multiple exerciseIds', async () => {
const exerciseIds = ['exerciseId1', 'exerciseId2', 'exerciseId3'];
const params = {
statuses: ['status1', 'status2'],
columns: ['column1', 'column2'],
whereClauses: [],
type: 'data',
stage: 'stage1',
stageStatus: 'status',
};
const columns = ['exerciseRef','referenceNumber'];

const wrapped = wrap(getMultipleApplicationData);
const context = generateMockContext({
Expand All @@ -50,7 +43,7 @@ describe('getMultipleApplicationData', () => {
],
});

const result = await wrapped({ exerciseIds, params }, context);
const result = await wrapped({ exerciseIds, columns }, context);
assert(Array.isArray(result), 'Result should be an array');
assert(result.length > 0, 'Result should contain data');
});
Expand Down
Loading