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

Fix onAuditLog #707

Merged
merged 3 commits into from
Aug 7, 2023
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
3 changes: 3 additions & 0 deletions lib/groups/getAuditLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function getAuditLog (group, actionType, userId, sortOrder, limit, cursor, jar)
reject(new Error(error))
} else {
responseData.data = responseData.data.map((entry) => {
// We need to set milliseconds to 0 because Roblox does this fascinating thing
// Where they vary the ms value on each request, for an existing action.
entry.created = new Date(entry.created)
entry.created.setMilliseconds(0)
return entry
})
resolve(responseData)
Expand Down
3 changes: 2 additions & 1 deletion lib/groups/onAuditLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ exports.func = function (args) {
if (audit) {
for (const key in audit.data) {
if (Object.prototype.hasOwnProperty.call(audit.data, key)) {
const date = new Date(audit.data[key].created.slice(0, audit.data[key].created.lastIndexOf('.')))
const date = audit.data[key].created

if (date > latest) {
latest = date
given.push(audit.data[key])
Expand Down