refactor: replace global Sha1 utility with importable hash function in PosStore

This commit is contained in:
Suherdy Yacob 2026-05-19 17:25:30 +07:00
parent fa564e86f0
commit 74ce803f20

View File

@ -1,9 +1,9 @@
/* global Sha1 */
import { patch } from "@web/core/utils/patch"; import { patch } from "@web/core/utils/patch";
import { PosStore } from "@point_of_sale/app/services/pos_store"; import { PosStore } from "@point_of_sale/app/services/pos_store";
import { _t } from "@web/core/l10n/translation"; import { _t } from "@web/core/l10n/translation";
import { NumberPopup } from "@point_of_sale/app/components/popups/number_popup/number_popup"; import { NumberPopup } from "@point_of_sale/app/components/popups/number_popup/number_popup";
import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog"; import { makeAwaitable } from "@point_of_sale/app/utils/make_awaitable_dialog";
import { hash } from "@pos_hr/app/utils/hash";
patch(PosStore.prototype, { patch(PosStore.prototype, {
async setTableFromUi(table, orderUuid = null) { async setTableFromUi(table, orderUuid = null) {
@ -66,7 +66,7 @@ patch(PosStore.prototype, {
return false; return false;
} }
const hashedPin = Sha1.hash(inputPin); const hashedPin = hash(inputPin);
const allEmployees = this.models["hr.employee"].getAll(); const allEmployees = this.models["hr.employee"].getAll();
const employee = allEmployees.find(emp => emp._pin === hashedPin); const employee = allEmployees.find(emp => emp._pin === hashedPin);