REST Service for POPCORN - ILIAS
alex
2025-06-16 24bd3990c410dbbfbdc610d7ad1836c5efd9ca78
lib/libIlias.js
@@ -25,24 +25,28 @@
   let url2 = `${url}?${sp.toString()}`
   const res = await fetch(url2, {method: "DELETE"})
   const data = await res.json()
   // TODO update search index
   return data //
}
async function deleteAllUsers () {
   const users = await db.getUsers()
   const {data: users} = await db.getUsers(0, 100000)
   const res = {
      command: "deleteAllUsers",
      start: new Date(),
      end: new Date(),
      duration: null,
      count: 0,
      userIds: [],
   }
   for (const user of users) {
      await deleteUser(user.usr_id)
      res.count += 1
      res.userIds.push(user.usr_id)
   }
   res.end = new Date()
   res.duration = res.end - res.start
   // TODO update search index
   return res
}