mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
feat: rewrite project
This commit is contained in:
14
src/services/study-service.ts
Normal file
14
src/services/study-service.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export class StudyService {
|
||||
constructor(
|
||||
private db: DbClient,
|
||||
private storage: StorageClient
|
||||
) {}
|
||||
|
||||
async createStudy(params: CreateStudyParams) {
|
||||
return this.db.transaction(async (tx) => {
|
||||
const study = await tx.insert(studies).values(params).returning()
|
||||
await this.storage.putObject("studies", study.id, params.config)
|
||||
return study
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user