Chore/link module serialization (#11643)
This commit is contained in:
1 parent
c50487ccab
commit
228b7b608d
2 files changed
+13
-6
No files matched your search
@@ -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()
|
@InjectManager()
|
||||||
@@ -150,7 +150,7 @@ export default class LinkModuleService implements ILinkModule {
|
|||||||
|
|
||||||
const rows = await this.linkService_.list(filters, config, sharedContext)
|
const rows = await this.linkService_.list(filters, config, sharedContext)
|
||||||
|
|
||||||
return rows.map((row) => row.toJSON())
|
return (await this.baseRepository_.serialize(rows)) as unknown[]
|
||||||
}
|
}
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@@ -163,13 +163,15 @@ export default class LinkModuleService implements ILinkModule {
|
|||||||
config.take = null
|
config.take = null
|
||||||
}
|
}
|
||||||
|
|
||||||
const [rows, count] = await this.linkService_.listAndCount(
|
let [rows, count] = await this.linkService_.listAndCount(
|
||||||
filters,
|
filters,
|
||||||
config,
|
config,
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
|
|
||||||
return [rows.map((row) => row.toJSON()), count]
|
rows = (await this.baseRepository_.serialize(rows)) as unknown[]
|
||||||
|
|
||||||
|
return [rows, count]
|
||||||
}
|
}
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@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()
|
@InjectTransactionManager()
|
||||||
@@ -243,7 +245,7 @@ export default class LinkModuleService implements ILinkModule {
|
|||||||
|
|
||||||
const links = await this.linkService_.dismiss(data, sharedContext)
|
const links = await this.linkService_.dismiss(data, sharedContext)
|
||||||
|
|
||||||
return links.map((row) => row.toJSON())
|
return (await this.baseRepository_.serialize(links)) as unknown[]
|
||||||
}
|
}
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
|||||||
Reference in new issue
Block a user