@hedhog/admin 0.0.56 → 0.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,5 +1,4 @@
1
1
  import {
2
- getRepository,
3
2
  MigrationInterface,
4
3
  QueryRunner,
5
4
  Table,
@@ -124,18 +123,14 @@ export class Migrate implements MigrationInterface {
124
123
  ];
125
124
 
126
125
  for (const menu of menus) {
127
- const menuRepository = getRepository(Menu);
126
+ const menuInserted = await queryRunner.manager.insert(Menu, {
127
+ url: menu.url,
128
+ order: menu.order,
129
+ icon: menu.icon,
130
+ slug: menu.slug,
131
+ });
128
132
 
129
- const m = await menuRepository.save(
130
- await menuRepository.create({
131
- url: menu.url,
132
- order: menu.order,
133
- icon: menu.icon,
134
- slug: menu.slug,
135
- }),
136
- );
137
-
138
- console.log('menu', m);
133
+ console.log('menuInserted', menuInserted);
139
134
 
140
135
  await queryRunner.manager
141
136
  .createQueryBuilder()
@@ -143,12 +138,12 @@ export class Migrate implements MigrationInterface {
143
138
  .into('menu_translations', ['menu_id', 'locale_id', 'name'])
144
139
  .values([
145
140
  {
146
- menu_id: m.id,
141
+ menu_id: menuInserted.identifiers[0].id,
147
142
  locale_id: 1,
148
143
  name: menu.name_en,
149
144
  },
150
145
  {
151
- menu_id: m.id,
146
+ menu_id: menuInserted.identifiers[0].id,
152
147
  locale_id: 2,
153
148
  name: menu.name_pt,
154
149
  },