Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let wemTreatmentCategories: Array<any> = await getConnection("wem").query(`SELECT * FROM "perfectshape_sql_test"."dbo"."Treatmentcat" WHERE "parent" = 0`);
- for(let i = 0; i < wemTreatmentCategories.length; i++){
- const wemTreatmentCategory = wemTreatmentCategories[i];
- if(!wemTreatmentCategoryIds.includes(wemTreatmentCategory.id)){
- const treatmentCategory = TreatmentCategory.create({
- name: wemTreatmentCategory.name,
- status: wemTreatmentCategory.deleted == 0 ? TreatmentCategoryStatus.ACTIVE : TreatmentCategoryStatus.INACTIVE,
- wemId: wemTreatmentCategory.id,
- });
- await treatmentCategory.save();
- wemToPosMap[wemTreatmentCategory.id] = treatmentCategory.id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement