Fakultas Ilmu Komputer UI

Commit 562bcd32 authored by Sean Zeliq Urian's avatar Sean Zeliq Urian
Browse files

Merge branch 'sean/tampilan-log-aktivitas' into 'PBI-14-Log-Aktivitas'

Polishing filter and log message

See merge request !46
parents 9e40fcf6 90b71a87
Pipeline #80184 passed with stages
in 9 minutes and 12 seconds
......@@ -53,9 +53,16 @@ export default function ActivityList() {
ignoreDateFilterQuery: boolean
) => {
let dateOnly = {
start_date: dateFilterQuery.start_date.toISOString().split('T')[0],
end_date: dateFilterQuery.end_date.toISOString().split('T')[0],
start_date: new Date(
dateFilterQuery.start_date.valueOf() + 1000 * 3600 * 24
)
.toISOString()
.split('T')[0],
end_date: new Date(dateFilterQuery.end_date.valueOf() + 1000 * 3600 * 24)
.toISOString()
.split('T')[0],
};
setIsLoading(true);
const logResponse = await services.main.getLog(
page,
......@@ -65,10 +72,7 @@ export default function ActivityList() {
ignoreDateFilterQuery
);
console.log(logResponse);
let logs: Log[] = [];
console.log(logResponse.data.results);
if (
logResponse.data.results !== undefined &&
logResponse.data.results.length > 0
......
......@@ -34,9 +34,16 @@ export default function ActivityTabel() {
ignoreDateFilterQuery: boolean
) => {
let dateOnly = {
start_date: dateFilterQuery.start_date.toISOString().split('T')[0],
end_date: dateFilterQuery.end_date.toISOString().split('T')[0],
start_date: new Date(
dateFilterQuery.start_date.valueOf() + 1000 * 3600 * 24
)
.toISOString()
.split('T')[0],
end_date: new Date(dateFilterQuery.end_date.valueOf() + 1000 * 3600 * 24)
.toISOString()
.split('T')[0],
};
const logResponse = await services.main.getLog(
page,
roleFilterQuery,
......
......@@ -70,6 +70,13 @@ const generateLogMessage = async (log: any, services: any) => {
break;
}
}
if (log.author.is_admin) {
message = '[Admin] ' + message;
} else {
message = '[Kader] ' + message;
}
return message;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment