import { schema } from '@osd/config-schema' ; import { IRouter } from '../../http' ; export const registerDeleteRoute = ( router ) => { router . delete ( { path : '/{type}/{id}' , validate : { params : schema . object ( { type : schema . string ( ) , id : schema . string ( ) , } ) , query : schema . object ( { force : schema . maybe ( schema . boolean ( ) ) , } ) , } , } , router . handleLegacyErrors ( async ( context , req , res ) => { const { type , id } = req . params ; const { force } = req . query ; const result = await context . core . savedObjects . client . delete ( type , id , { force } ) ; return res . ok ( { body : result } ) ; } ) ) ; } ;