Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77f31cf

Browse files
committed
remove update method on elastic repository
1 parent95bf5d6 commit77f31cf

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

‎src/Contexts/Backoffice/Courses/infrastructure/persistence/ElasticBackofficeCourseRepository.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ export class ElasticBackofficeCourseRepository
1111
}
1212

1313
asyncsave(course:BackofficeCourse):Promise<void>{
14-
constcurrentCourse=awaitthis.findById(course.id.value,BackofficeCourse.fromPrimitives);
15-
if(currentCourse){
16-
returnthis.update(course.id.value,course);
17-
}
18-
1914
returnthis.persist(course.id.value,course);
2015
}
2116

‎src/Contexts/Shared/infrastructure/persistence/elasticsearch/ElasticRepository.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import bodybuilder, { Bodybuilder } from 'bodybuilder';
44
importhttpStatusfrom'http-status';
55
import{AggregateRoot}from'../../../domain/AggregateRoot';
66
import{Criteria}from'../../../domain/criteria/Criteria';
7-
import{Nullable}from'../../../domain/Nullable';
87
importElasticConfigfrom'./ElasticConfig';
98
import{ElasticCriteriaConverter,TypeQueryEnum}from'./ElasticCriteriaConverter';
109

@@ -65,24 +64,4 @@ export abstract class ElasticRepository<T extends AggregateRoot> {
6564

6665
awaitclient.index({index:this.indexName(), id,body:document,refresh:'wait_for'});// wait_for wait for a refresh to make this operation visible to search
6766
}
68-
69-
update(id:string,course:T):Promise<void>{
70-
returnthis.persist(id,course);
71-
}
72-
73-
protectedasyncfindById(id:string,unserializer:(data:any)=>T):Promise<Nullable<T>>{
74-
constclient=awaitthis.client();
75-
try{
76-
const{ body}=awaitclient.get({
77-
index:this.indexName(),
78-
id
79-
});
80-
returnunserializer(body._source);
81-
}catch(e){
82-
if(this.isNotFoundError(e)){
83-
returnnull;
84-
}
85-
throwe;
86-
}
87-
}
8867
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp