prettier fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use server"
|
||||
'use server';
|
||||
|
||||
import { applyPromotions } from "@lib/data/cart"
|
||||
import { applyPromotions } from '@lib/data/cart';
|
||||
|
||||
export async function addPromotionCodeAction(code: string) {
|
||||
try {
|
||||
@@ -12,9 +12,14 @@ export async function addPromotionCodeAction(code: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function removePromotionCodeAction(codeToRemove: string, appliedCodes: string[]) {
|
||||
export async function removePromotionCodeAction(
|
||||
codeToRemove: string,
|
||||
appliedCodes: string[],
|
||||
) {
|
||||
try {
|
||||
const updatedCodes = appliedCodes.filter((appliedCode) => appliedCode !== codeToRemove);
|
||||
const updatedCodes = appliedCodes.filter(
|
||||
(appliedCode) => appliedCode !== codeToRemove,
|
||||
);
|
||||
await applyPromotions(updatedCodes);
|
||||
return { success: true, message: 'Discount code removed successfully' };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user