Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pnm-public
camino
Commits
b95aa6dd
Unverified
Commit
b95aa6dd
authored
3 years ago
by
BITARD Michaël
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(api): le téléchargement des titres filtrés fonctionne (#117)
parent
477d0ac7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/api/src/api/rest/_convert.ts
+10
-0
10 additions, 0 deletions
packages/api/src/api/rest/_convert.ts
packages/api/src/api/rest/index.ts
+15
-12
15 additions, 12 deletions
packages/api/src/api/rest/index.ts
with
25 additions
and
12 deletions
packages/api/src/api/rest/_convert.ts
+
10
−
0
View file @
b95aa6dd
...
...
@@ -16,6 +16,16 @@ const tableConvert = (
const
sheet
=
xlsx
.
utils
.
json_to_sheet
(
elements
as
Index
<
any
>
[])
if
(
format
===
'
xlsx
'
)
{
const
cells
=
Object
.
keys
(
sheet
)
for
(
const
cell
of
cells
)
{
if
(
typeof
sheet
[
cell
].
v
===
'
string
'
&&
sheet
[
cell
].
v
.
length
>
32767
)
{
sheet
[
cell
].
v
=
'
la cellule est trop grosse pour le format xlsx, veuillez télécharger le document en ods si vous voulez y accéder
'
}
}
}
if
(
format
===
'
csv
'
)
{
contenu
=
xlsx
.
utils
.
sheet_to_csv
(
sheet
)
}
else
if
(
format
===
'
xlsx
'
||
format
===
'
ods
'
)
{
...
...
This diff is collapsed.
Click to expand it.
packages/api/src/api/rest/index.ts
+
15
−
12
View file @
b95aa6dd
...
...
@@ -32,6 +32,7 @@ import { entreprisesFormatTable } from './format/entreprises'
import
{
matomo
}
from
'
../../tools/matomo
'
import
{
isRole
}
from
'
camino-common/src/roles
'
import
{
stringSplit
}
from
'
../../database/queries/_utils
'
const
formatCheck
=
(
formats
:
string
[],
format
:
string
)
=>
{
if
(
!
formats
.
includes
(
format
))
{
...
...
@@ -99,9 +100,9 @@ interface ITitresQueryInput {
domainesIds
?:
string
|
null
typesIds
?:
string
|
null
statutsIds
?:
string
|
null
substances
?:
string
|
null
nom
s
?:
string
|
null
entreprises
?:
string
|
null
substances
LegalesIds
?:
string
|
null
titresId
s
?:
string
|
null
entreprises
Ids
?:
string
|
null
references
?:
string
|
null
territoires
?:
string
|
null
perimetre
?:
number
[]
|
null
...
...
@@ -116,9 +117,9 @@ const titres = async (
typesIds
,
domainesIds
,
statutsIds
,
substances
,
nom
s
,
entreprises
,
substances
LegalesIds
,
titresId
s
,
entreprises
Ids
,
references
,
territoires
,
perimetre
...
...
@@ -137,9 +138,11 @@ const titres = async (
typesIds
:
typesIds
?.
split
(
'
,
'
),
domainesIds
:
domainesIds
?.
split
(
'
,
'
),
statutsIds
:
statutsIds
?.
split
(
'
,
'
),
substances
,
noms
,
entreprises
,
ids
:
titresIds
?
stringSplit
(
titresIds
)
:
null
,
entreprisesIds
:
entreprisesIds
?
stringSplit
(
entreprisesIds
)
:
null
,
substancesLegalesIds
:
substancesLegalesIds
?
stringSplit
(
substancesLegalesIds
)
:
null
,
references
,
territoires
,
perimetre
...
...
@@ -172,9 +175,9 @@ const titres = async (
typesIds
,
domainesIds
,
statutsIds
,
substances
,
nom
s
,
entreprises
,
substances
LegalesIds
,
titresId
s
,
entreprises
Ids
,
references
,
territoires
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment