@hedhog/admin 0.0.55 → 0.0.57

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -60,7 +60,7 @@ export class Migrate implements MigrationInterface {
60
60
  await queryRunner.manager
61
61
  .createQueryBuilder()
62
62
  .insert()
63
- .into('multifactors', ['id'])
63
+ .into('multifactors', ['id', 'slug'])
64
64
  .values([
65
65
  {
66
66
  id: 1,
@@ -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
  },