TDN
Tiến Dũng Nguyễn

Voucher Management - Copy this React, Tailwind Component to your project

Create voucher management page Use authconfig when using api Create new voucher api https://domstore.azurewebsites.net/#/Vouchers/post_api_v1_vouchers Submission content { "code": "CODEDUIDUI", "discountPercent": 10, "expirationDate": "2024 10 20", "quantity": 100 } Get all vouchers https://domstore.azurewebsites.net/#/Vouchers/get_api_v1_vouchers Retrieved content { "status": "success", "message": "Get list of vouchers successfully", "data": { "vouchers": [ { "_id": "673631b13af141ca5f62a04f", "code": "1121", "discountPercent": 0, "expirationDate": "0012 12 12T00:00:00.000Z", "quantity": 12, "createdAt": "2024 11 14T17:21:53.504Z" }, "_id": "6736c39efeaa3e0adb006b5c", "code": "131", "discountPercent": 0, "expirationDate": "2222 02 22T00:00:00.000Z", "quantity": 1, "createdAt": "2024 11 15T03:44:30.064Z" }, { "_id": "6736ee8ec5e479ae730d1acf", "code": "12", "discountPercent": 0, "expirationDate": "2024 11 16T00:00:00.000Z", "quantity": 12, "createdAt" : "2024 11 15T06:47:42.793Z" } ] } } Edit vvoucher api https://domstore.azurewebsites.net/#/Vouchers/put_api_v1_vouchers__id_ Content to send { "discountPercent": 10, "expirationDate": "2024 10 20", "quantity": 100 } Delete voucher api https://domstore.azurewebsites.net/#/Vouchers/delete_api_v1_vouchers__id_ Get a specific voucher api https://domstore.azurewebsites.net/#/Vouchers/get_api_v1_vouchers__id_ Get information { "status": "success", "message": "Get voucher information successfully", "data": { "voucher": { "_id": "6736c39efeaa3e0adb006b5c", "code": "131", "discountPercent": 0, "expirationDate": "2222 02 22T00:00:00.000Z", "quantity": 1, "createdAt": "2024 11 15T03:44:30.064Z" } } } Voucher api statistics https://domstore.azurewebsites.net/#/Vouchers/get_api_v1_vouchers__id__stats Data get { "status": "success", "message": "Get voucher statistics successfully", "data": { "voucherId": "6736c39efeaa3e0adb006b5c", "code": "131", "totalQuantity": 1, "usedCount": 0, "remainingCount": 1, "expirationDate": "2222 02 22T00:00:00.000Z" } } Delete expired voucher https://domstore.azurewebsites.net/#/Vouchers/post_api_v1_vouchers_deactivate_expired

Prompt
Component Preview

About

VoucherManagement - Create, edit, and delete vouchers easily with APIs. Built with React and Tailwind for a sleek UI. Copy component code!

Share

Last updated 1 month ago