async updateAreaType(input: RouterInput['updateAreaType'], ctx: Context): RouterOutput['updateAreaType'] {
console.log('Area.Service.updateAreaType', input.areaTypeId, input.data);
const updatedAreaType = await ctx.app.model.AreaType.findByIdAndUpdate(input.areaTypeId, input.data, { new: true })
.lean()
.exec();
if (!updatedAreaType) {
throw new Error('AreaType update failed');
}
return updatedAreaType as AreaType;
}
async updateAreaType(input: RouterInput['updateAreaType'], ctx: Context): RouterOutput['updateAreaType'] {
console.log('Area.Service.updateAreaType', input.areaTypeId, input.data);
const updatedAreaType = await ctx.app.model.AreaType.findByIdAndUpdate(input.areaTypeId, input.data, { new: true })
.lean()
.exec();
if (!updatedAreaType) {
throw new Error('AreaType update failed');
}
return updatedAreaType as AreaType;
}