ReferencesController.mjs 579 B

1234567891011121314151617181920
  1. import EditorRealTimeController from '../Editor/EditorRealTimeController.mjs'
  2. export default {
  3. indexAll(req, res, next) {
  4. const projectId = req.params.Project_id
  5. const { shouldBroadcast, clientId } = req.body
  6. // We've migrated to client side indexing, so we only use the message for
  7. // broadcasting that the clients need to re-index.
  8. if (shouldBroadcast) {
  9. EditorRealTimeController.emitToRoom(
  10. projectId,
  11. 'references:keys:updated',
  12. [],
  13. true,
  14. clientId
  15. )
  16. }
  17. res.json({ projectId, keys: [] })
  18. },
  19. }