Chore/link module serialization (#11643)
This commit is contained in:
committed by
GitHub
parent
c50487ccab
commit
228b7b608d
5
.changeset/old-shirts-wash.md
Normal file
5
.changeset/old-shirts-wash.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/link-modules": patch
|
||||
---
|
||||
|
||||
Chore/link module serialization
|
||||
@@ -135,7 +135,7 @@ export default class LinkModuleService implements ILinkModule {
|
||||
)
|
||||
}
|
||||
|
||||
return entry[0]
|
||||
return (await this.baseRepository_.serialize(entry[0])) as unknown
|
||||
}
|
||||
|
||||
@InjectManager()
|
||||
@@ -150,7 +150,7 @@ export default class LinkModuleService implements ILinkModule {
|
||||
|
||||
const rows = await this.linkService_.list(filters, config, sharedContext)
|
||||
|
||||
return rows.map((row) => row.toJSON())
|
||||
return (await this.baseRepository_.serialize(rows)) as unknown[]
|
||||
}
|
||||
|
||||
@InjectManager()
|
||||
@@ -163,13 +163,15 @@ export default class LinkModuleService implements ILinkModule {
|
||||
config.take = null
|
||||
}
|
||||
|
||||
const [rows, count] = await this.linkService_.listAndCount(
|
||||
let [rows, count] = await this.linkService_.listAndCount(
|
||||
filters,
|
||||
config,
|
||||
sharedContext
|
||||
)
|
||||
|
||||
return [rows.map((row) => row.toJSON()), count]
|
||||
rows = (await this.baseRepository_.serialize(rows)) as unknown[]
|
||||
|
||||
return [rows, count]
|
||||
}
|
||||
|
||||
@InjectTransactionManager()
|
||||
@@ -218,7 +220,7 @@ export default class LinkModuleService implements ILinkModule {
|
||||
}))
|
||||
)
|
||||
|
||||
return links.map((row) => row.toJSON())
|
||||
return (await this.baseRepository_.serialize(links)) as unknown[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager()
|
||||
@@ -243,7 +245,7 @@ export default class LinkModuleService implements ILinkModule {
|
||||
|
||||
const links = await this.linkService_.dismiss(data, sharedContext)
|
||||
|
||||
return links.map((row) => row.toJSON())
|
||||
return (await this.baseRepository_.serialize(links)) as unknown[]
|
||||
}
|
||||
|
||||
@InjectTransactionManager()
|
||||
|
||||
Reference in New Issue
Block a user