update user purchase list
This commit is contained in:
parent
18647091cf
commit
f9356c6bbe
@ -1,3 +1,6 @@
|
||||
// userPurchaseHandler.js
|
||||
|
||||
|
||||
import config from "../../config/config.js";
|
||||
import db from '../../config/database.js';
|
||||
import PurchaseService from "../../services/purchaseService.js";
|
||||
@ -43,7 +46,8 @@ export default class UserPurchaseHandler {
|
||||
const keyboard = {
|
||||
inline_keyboard: [
|
||||
...purchases.map(item => [{
|
||||
text: `${item.product_name} [${new Date(item.purchase_date).toLocaleString()}]`,
|
||||
// Добавляем иконку статуса покупки
|
||||
text: `${item.status === 'received' ? '✅' : '❌'} ${item.product_name} [${new Date(item.purchase_date).toLocaleString()}]`,
|
||||
callback_data: `view_purchase_${item.id}`
|
||||
}]),
|
||||
[
|
||||
|
@ -1,3 +1,5 @@
|
||||
// productService.js
|
||||
|
||||
import db from "../config/database.js";
|
||||
|
||||
class ProductService {
|
||||
|
@ -1,3 +1,5 @@
|
||||
// purchaseService.js
|
||||
|
||||
import db from "../config/database.js";
|
||||
import CryptoJS from "crypto-js"; // Импортируем библиотеку crypto-js
|
||||
class PurchaseService {
|
||||
|
Loading…
Reference in New Issue
Block a user