// // Copyright © 2023 Hardcore Engineering Inc. // import type { Question } from '@hcengineering/questions' import { getClient } from '@hcengineering/presentation' import { canUpdateQuestion } from '../utils' import { eachItemActionWithAvailability } from './ActionWithAvailability' export const questionDeleteAction = eachItemActionWithAvailability>( async (object: Question) => { return canUpdateQuestion(object) }, async (object: Question) => { // TODO: Do we need a confirmation popup? await getClient().removeCollection( object._class, object.space, object._id, object.attachedTo, object.attachedToClass, object.collection ) }, true )