• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CSCfi / metadata-submitter-frontend / 15132822209

20 May 2025 08:35AM UTC coverage: 47.784% (-0.08%) from 47.859%
15132822209

push

github

Hang Le
Feature/fix formatting (merge commit)

Merge branch 'feature/fix-formatting' into 'main'
* Format all files missed by incorrect format script

* Update precommit for husky v9

* Fix formatting script to include all files

Closes #1033
See merge request https://gitlab.ci.csc.fi/sds-dev/sd-submit/metadata-submitter-frontend/-/merge_requests/1114

Approved-by: Hang Le <lhang@csc.fi>
Co-authored-by: Monika Radaviciute <mradavic@csc.fi>
Merged by Hang Le <lhang@csc.fi>

656 of 963 branches covered (68.12%)

Branch coverage included in aggregate %.

150 of 326 new or added lines in 48 files covered. (46.01%)

5 existing lines in 4 files now uncovered.

6353 of 13705 relevant lines covered (46.36%)

4.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.86
/src/services/draftAPI.ts
1
import { create } from "apisauce"
1✔
2
import { omit } from "lodash"
1✔
3

4
import { errorMonitor } from "./errorMonitor"
1✔
5

6
import { OmitObjectValues } from "constants/wizardObject"
1✔
7
import { APIResponse } from "types"
8

9
const api = create({ baseURL: "/v1/drafts" })
1✔
10
api.addMonitor(errorMonitor)
1✔
11

12
const createFromJSON = async (
1✔
13
  objectType: string,
×
14
  submissionId: string,
×
15
  JSONContent: Record<string, unknown>
×
16
): Promise<APIResponse> => {
×
17
  return await api.post(`/${objectType}?submission=${submissionId}`, JSONContent)
×
18
}
×
19

20
const getObjectByAccessionId = async (
1✔
NEW
21
  objectType: string,
×
NEW
22
  accessionId: string
×
NEW
23
): Promise<APIResponse> => {
×
24
  return await api.get(`/${objectType}/${accessionId}`)
×
25
}
×
26

27
const patchFromJSON = async (
1✔
28
  objectType: string,
×
29
  accessionId: string,
×
30
  JSONContent: Record<string, unknown>
×
31
): Promise<APIResponse> => {
×
32
  return await api.patch(`/${objectType}/${accessionId}`, omit(JSONContent, OmitObjectValues))
×
33
}
×
34

35
const getAllObjectsByObjectType = async (objectType: string): Promise<APIResponse> => {
1✔
36
  return await api.get(`/${objectType}`)
×
37
}
×
38

39
const deleteObjectByAccessionId = async (
1✔
NEW
40
  objectType: string,
×
NEW
41
  accessionId: string
×
NEW
42
): Promise<APIResponse> => {
×
43
  return await api.delete(`/${objectType}/${accessionId}`)
×
44
}
×
45

46
export default {
1✔
47
  createFromJSON,
1✔
48
  getObjectByAccessionId,
1✔
49
  patchFromJSON,
1✔
50
  getAllObjectsByObjectType,
1✔
51
  deleteObjectByAccessionId,
1✔
52
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc