Files
lecture-front/src/components/services/ordersService.js
2025-03-27 00:15:06 +03:00

28 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const fetchServiceItems = () => {
return new Promise((resolve) => {
setTimeout(() => {resolve([
{ id: 1, techName: "Принтер", createdAt: "2025-01-10", status: "done" },
{ id: 2, techName: "Ноутбук", createdAt: "2024-01-10", status: "issued" },
{ id: 3, techName: "Смартфон Vivo", createdAt: "2025-02-10", status: "in_progress" },
{ id: 4, techName: "Повербанк", createdAt: "2024-11-10", status: "waiting" },
{ id: 5, techName: "Монитор Samsung", createdAt: "2025-03-01", status: "waiting_details" },
{ id: 6, techName: "Компьютер Эльбрус", createdAt: "2025-02-15", status: "accept1" }
])}, 5000)
})
};
const RU_STATUSES = {
done: "Готово",
issued: "Выдан",
in_progress: "В ремонте",
waiting: "Требует уточнения",
waiting_details: "В ожидании деталей",
accept: "Принят"
};
export const getServiceItemsForRender = async () => {
return (await fetchServiceItems()).map((value) => {
value.status = RU_STATUSES[value.status];
return value;
});
}