Refactor medication model to use blisters and pills instead of strips and tabs
- Updated medication schema to replace stripsPerPack and tabsPerStrip with blistersPerPack and pillsPerBlister. - Adjusted medication routes to handle new blister and pill structure, including calculations for total pills. - Modified frontend components to reflect changes in medication data structure and ensure compatibility with new backend logic. - Updated reminder scheduler and share routes to utilize the new medication model. - Enhanced Docker configuration for better permissions handling during development.
This commit is contained in:
@@ -107,14 +107,15 @@ export async function shareRoutes(app: FastifyInstance) {
|
||||
blisters = [];
|
||||
}
|
||||
|
||||
const totalPills = med.packCount * med.blistersPerPack * med.pillsPerBlister + med.looseTablets;
|
||||
return {
|
||||
id: med.id,
|
||||
name: med.name,
|
||||
genericName: med.genericName,
|
||||
pillWeightMg: med.pillWeightMg,
|
||||
imageUrl: med.imageUrl,
|
||||
count: med.count,
|
||||
tabsPerStrip: med.tabsPerStrip,
|
||||
totalPills,
|
||||
pillsPerBlister: med.pillsPerBlister,
|
||||
blisters,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user