Advertisement
y2kbug

Untitled

Mar 4th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let wemTreatmentCategories: Array<any> = await getConnection("wem").query(`SELECT * FROM "perfectshape_sql_test"."dbo"."Treatmentcat" WHERE "parent" = 0`);
  2.       for(let i = 0; i < wemTreatmentCategories.length; i++){
  3.         const wemTreatmentCategory = wemTreatmentCategories[i];
  4.  
  5.         if(!wemTreatmentCategoryIds.includes(wemTreatmentCategory.id)){
  6.           const treatmentCategory = TreatmentCategory.create({
  7.             name: wemTreatmentCategory.name,
  8.             status: wemTreatmentCategory.deleted == 0 ? TreatmentCategoryStatus.ACTIVE : TreatmentCategoryStatus.INACTIVE,
  9.             wemId: wemTreatmentCategory.id,
  10.           });
  11.  
  12.           await treatmentCategory.save();
  13.  
  14.           wemToPosMap[wemTreatmentCategory.id] = treatmentCategory.id;
  15.         }
  16.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement