Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hdfc-common-utility
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roshan Suvarnkar
hdfc-common-utility
Compare revisions
d9c674d1e6ae430f55672826e8994980fef0dace to d32806f5eb726e40f38b0796a51a51edfe8bb888
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
roshan.suvarnkar/hdfc-common-utility
Select target project
No results found
d32806f5eb726e40f38b0796a51a51edfe8bb888
Select Git revision
Branches
develop
fSearch
fuzzySearch
fuzzySearchChanges
hotFixInFuzzySearch
hotFixSeedFunction
master
7 results
Swap
Target
roshan.suvarnkar/hdfc-common-utility
Select target project
roshan.suvarnkar/hdfc-common-utility
1 result
d9c674d1e6ae430f55672826e8994980fef0dace
Select Git revision
Branches
develop
fSearch
fuzzySearch
fuzzySearchChanges
hotFixInFuzzySearch
hotFixSeedFunction
master
7 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
2
Changes in fuzzy Search, Added primary key as args
· 60ed83de
Prathviraj Suryakant Thokal
authored
1 month ago
60ed83de
Merge branch 'hotFixInFuzzySearch' into 'develop'
· d32806f5
Roshan Suvarnkar
authored
1 month ago
Changes in fuzzy Search, Added primary key as args See merge request
!5
d32806f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/prisma.utils.ts
+3
-1
3 additions, 1 deletion
src/utils/prisma.utils.ts
with
3 additions
and
1 deletion
src/utils/prisma.utils.ts
View file @
d32806f5
...
...
@@ -233,6 +233,7 @@ interface FuzzySearchArgs {
select
?:
string
[];
include
?:
Record
<
string
,
boolean
>
;
distinct
?:
string
[];
primaryKey
?:
string
;
}
export
type
FuzzySearchResult
<
T
>
=
{
...
...
@@ -406,10 +407,11 @@ export async function fuzzySearch<T>(
}
if
(
include
)
{
const
primaryKey
=
args
.
primaryKey
||
'
id
'
;
const
includedData
=
await
Promise
.
all
(
data
.
map
((
item
:
any
)
=>
extended
[
model
].
findUnique
({
where
:
{
id
:
item
.
id
},
where
:
{
[
primaryKey
]:
item
[
primaryKey
]
},
include
,
})
as
unknown
as
T
)
...
...
This diff is collapsed.
Click to expand it.