chore: Remove typeORM (#9005)
* chore: rename js files to txt * chore: rename ts files to txt * chore: delete environment helpers * chore: convert global setup & teardown to txt * chore: rename helper js/ts files to txt * chore: rename seeder js/ts files to txt * chore: remove typeorm * chore: reintroduce used helpers
This commit is contained in:
1 parent
440f598de8
commit
0573bb924a
124 files changed
+80
-1386
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { AnalyticsConfig } from "@medusajs/medusa"
|
||||
import { DataSource } from "typeorm"
|
||||
|
||||
export type AnalyticsConfigData = {
|
||||
id?: string
|
||||
user_id?: string
|
||||
opt_out?: boolean
|
||||
anonymize?: boolean
|
||||
}
|
||||
|
||||
export const simpleAnalyticsConfigFactory = async (
|
||||
dataSource: DataSource,
|
||||
data: AnalyticsConfigData = {}
|
||||
): Promise<AnalyticsConfig> => {
|
||||
const manager = dataSource.manager
|
||||
|
||||
const job = manager.create<AnalyticsConfig>(AnalyticsConfig, {
|
||||
id: data.id ?? "test-analytics-config",
|
||||
user_id: data.user_id ?? "admin_user",
|
||||
opt_out: data.opt_out ?? false,
|
||||
anonymize: data.anonymize ?? false,
|
||||
})
|
||||
|
||||
return await manager.save<AnalyticsConfig>(job)
|
||||
}
|
||||
Reference in new issue
Block a user