Skip to content

Commit

Permalink
Merge pull request Roguelike-Celebration#879 from Roguelike-Celebrati…
Browse files Browse the repository at this point in the history
…on/fix-entryway-button

Log moveAllUsersToEntryway
  • Loading branch information
MoyTW authored Oct 19, 2024
2 parents ab321fc + fb6f897 commit 58d7ca2
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions server/src/endpoints/moveAllUsersToEntryway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,29 @@ const moveAllUsersToEntryway: AuthenticatedEndpointFunction = async (user: User,

let allMessages: Message[] = []
let managementTasks: GroupManagementTask[] = []

const allUsers = await DB.getAllUsers()
for (const user of allUsers) {
const tasks = await moveToRoom(user, 'entryway')
if (tasks && tasks.messages) {
allMessages = allMessages.concat(tasks.messages)
}
if (tasks && tasks.groupManagementTasks) {
managementTasks = managementTasks.concat(tasks.groupManagementTasks)

try {
for (const user of allUsers) {
const tasks = await moveToRoom(user, 'entryway')
if (tasks && tasks.messages) {
allMessages = allMessages.concat(tasks.messages)
}
if (tasks && tasks.groupManagementTasks) {
managementTasks = managementTasks.concat(tasks.groupManagementTasks)
}
}
} catch (e) {
const err = e as Error
log("ERROR!")

Check failure on line 39 in server/src/endpoints/moveAllUsersToEntryway.ts

View workflow job for this annotation

GitHub Actions / build

Strings must use singlequote
log(err.message)
if (err.stack) { log(err.stack) }
}

log(allMessages)
log(managementTasks)

return {
httpResponse: {
status: 200,
Expand Down

0 comments on commit 58d7ca2

Please sign in to comment.