Skip to content

Fix getLogs function #370

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

Merged
merged 1 commit into from
May 24, 2016
Merged
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
Fix getLogs function
Right now the parse-dashboard is sending always the same 10 first info logs because no params are sent (it uses the default params from the parse-server).

Here the params are send in the querystring.

If someone has a better solution I'm interested :)
  • Loading branch information
poltib committed May 24, 2016
commit c50095e213079644c50309df81b7cd9fcb02ce7a
10 changes: 2 additions & 8 deletions src/lib/ParseApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,8 @@ export default class ParseApp {
* since - only fetch lines since this Date
*/
getLogs(level, since) {
let params = {
level: level,
n: 100,
};
if (since) {
params.startDate = since.getTime();
}
return this.apiRequest('GET', 'scriptlog', params, { useMasterKey: true });
let path = 'scriptlog?level=' + encodeURIComponent(level.toLowerCase()) + '&n=100' + (since?'&startDate=' + encodeURIComponent(since.getTime()):'');
return this.apiRequest('GET', path, {}, { useMasterKey: true });
}

/**
Expand Down