try {
const response = await airplaneRepository.update(id,data);
return response;
} catch (error) {
if(error.statusCodes = StatusCodes.NOT_FOUND) {
throw new AppError('The requested airplane to update does not exist',error.statusCodes)
}
throw new AppError('Cannot fetch data of all the airplanes', StatusCodes.INTERNAL_SERVER_ERROR );
}
}
inside airplane-Service
inside Controller
inside V1 routes