feat(medusa): Cart custom query strategy (#4083)
This commit is contained in:
@@ -216,6 +216,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AfterLoad,
|
||||
BeforeInsert,
|
||||
Column,
|
||||
Entity,
|
||||
@@ -390,6 +391,13 @@ export class Cart extends SoftDeletableEntity {
|
||||
gift_card_total?: number
|
||||
gift_card_tax_total?: number
|
||||
|
||||
@AfterLoad()
|
||||
private afterLoad(): void {
|
||||
if (this.payment_sessions) {
|
||||
this.payment_session = this.payment_sessions.find((p) => p.is_selected)!
|
||||
}
|
||||
}
|
||||
|
||||
@BeforeInsert()
|
||||
private beforeInsert(): void {
|
||||
this.id = generateEntityId(this.id, "cart")
|
||||
|
||||
Reference in New Issue
Block a user