feat: Create cart with line items (#6449)
**What** - Add support for creating a cart with items - Add endpoint `POST /store/carts/:id/line-items` - Add `CreateCartWorkflow` - Add `AddToCartWorkflow` - Add steps for both workflows **Testing** - Endpoints - Workflows I would still call this a first iteration, as we are missing a few pieces of the full flow, such as payment sessions, discounts, and taxes. Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
@@ -99,7 +99,7 @@ export class RedisDistributedTransactionStorage extends DistributedTransactionSt
|
||||
})
|
||||
}
|
||||
|
||||
private stringifyWithSymbol(key, value) {
|
||||
/*private stringifyWithSymbol(key, value) {
|
||||
if (key === "__type" && typeof value === "symbol") {
|
||||
return Symbol.keyFor(value)
|
||||
}
|
||||
@@ -113,12 +113,12 @@ export class RedisDistributedTransactionStorage extends DistributedTransactionSt
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
}*/
|
||||
|
||||
async get(key: string): Promise<TransactionCheckpoint | undefined> {
|
||||
const data = await this.redisClient.get(key)
|
||||
|
||||
return data ? JSON.parse(data, this.jsonWithSymbol) : undefined
|
||||
return data ? JSON.parse(data) : undefined
|
||||
}
|
||||
|
||||
async list(): Promise<TransactionCheckpoint[]> {
|
||||
@@ -129,7 +129,7 @@ export class RedisDistributedTransactionStorage extends DistributedTransactionSt
|
||||
for (const key of keys) {
|
||||
const data = await this.redisClient.get(key)
|
||||
if (data) {
|
||||
transactions.push(JSON.parse(data, this.jsonWithSymbol))
|
||||
transactions.push(JSON.parse(data))
|
||||
}
|
||||
}
|
||||
return transactions
|
||||
@@ -159,7 +159,7 @@ export class RedisDistributedTransactionStorage extends DistributedTransactionSt
|
||||
})
|
||||
}
|
||||
|
||||
const stringifiedData = JSON.stringify(data, this.stringifyWithSymbol)
|
||||
const stringifiedData = JSON.stringify(data)
|
||||
const parsedData = JSON.parse(stringifiedData)
|
||||
|
||||
if (!hasFinished) {
|
||||
|
||||
Reference in New Issue
Block a user