blob: 73d9a4f7e22390d919853f3043a4a8eb96ff023f [file] [log] [blame]
import {CCApi} from '../../../../common/api.js';
import {getAuthUser} from '../../../../common/communityConsoleUtils.js';
export default class ReadStateRunner {
execute(readState, thread) {
// Although this should in theory be the last message ID, it seems like
// setting 0 marks the entire thread as read anyways.
const lastMessageId = readState ? '0' : '-1';
return CCApi(
'SetUserReadStateBulk', {
// bulkItem:
1: [{
1: thread.forumId,
2: thread.threadId,
3: lastMessageId,
}],
},
/* authenticated = */ true, getAuthUser());
}
}