Skip to content

Commit

Permalink
fix: increase performance of inserting private parts
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladivo committed Aug 8, 2024
1 parent 6ceff48 commit 50d62ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/offer-service/src/db/OfferDbService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface OfferDbOperations {

insertOfferPrivatePart: (
args: InsertOfferPrivatePartRequest
) => Effect.Effect<PrivatePartRecord, UnexpectedServerError>
) => Effect.Effect<void, UnexpectedServerError>

updateRefreshOffer: (
args: UpdateRefreshOfferRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {PublicKeyPemBase64E} from '@vexl-next/cryptography/src/KeyHolder/brands'
import {UnexpectedServerError} from '@vexl-next/domain/src/general/commonErrors'
import {PrivatePayloadEncryptedE} from '@vexl-next/domain/src/general/offers'
import {Effect, flow} from 'effect'
import {PrivatePartRecord, PublicPartId} from '../domain'
import {PublicPartId} from '../domain'

export const InsertOfferPrivatePartRequest = Schema.Struct({
userPublicKey: PublicKeyPemBase64E,
Expand All @@ -21,9 +21,8 @@ export const createInsertOfferPrivatePart = Effect.gen(function* (_) {
const sql = yield* _(PgClient.PgClient)

const InsertOfferPrivateParts = yield* _(
SqlResolver.ordered('InsertOfferPrivatePart', {
SqlResolver.void('InsertOfferPrivatePart', {
Request: InsertOfferPrivatePartRequest,
Result: PrivatePartRecord,
execute: (requests) => {
return sql`
INSERT INTO
Expand Down

0 comments on commit 50d62ea

Please sign in to comment.