ztechno_core 0.0.45 → 0.0.46

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.
@@ -141,16 +141,20 @@ class ZTranslateService {
141
141
  }
142
142
  }
143
143
  async update(key, lang, data) {
144
- return await this.sql.query(
144
+ const res = await this.sql.query(
145
145
  `
146
146
  INSERT INTO translations
147
147
  (\`key\`, \`lang\`, \`value\`)
148
148
  VALUES
149
- (?, ?, ?)
150
- ON DUPLICATE KEY UPDATE value=?
149
+ (:key, :lang, :value)
150
+ ON DUPLICATE KEY UPDATE value=:value
151
151
  `,
152
- [key, lang, data.value, data.value],
152
+ { key, lang, value: data.value },
153
153
  );
154
+ if (res.affectedRows) {
155
+ this.insertLocalCache(key, lang, data);
156
+ }
157
+ return res;
154
158
  }
155
159
  checkLocalCache(key, lang) {
156
160
  const hasLocal = !this.localCache[lang].hasOwnProperty(key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztechno_core",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "Core files for ztechno framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",