• 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

58.0
/src/services/submissionAPI.ts
1
import { create } from "apisauce"
1✔
2

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

5
import { APIResponse, SubmissionDetails } from "types"
6

7
const api = create({ baseURL: "/v1/submissions" })
1✔
8

9
api.addMonitor(errorMonitor)
1✔
10

11
const createNewSubmission = async (submission: SubmissionDetails): Promise<APIResponse> => {
1✔
12
  return await api.post("", submission)
×
13
}
×
14

15
const getSubmissionById = async (submissionId: string): Promise<APIResponse> => {
1✔
16
  return await api.get(`/${submissionId}`)
4✔
17
}
4✔
18

19
const patchSubmissionById = async (
1✔
20
  submissionId: string,
×
NEW
21
  JSONContent: { name: string; description: string }
×
22
): Promise<APIResponse> => {
×
23
  return await api.patch(`/${submissionId}`, JSONContent)
×
24
}
×
25

26
const deleteSubmissionById = async (submissionId: string): Promise<APIResponse> => {
1✔
27
  return await api.delete(`/${submissionId}`)
×
28
}
×
29

30
const getSubmissions = async (params: {
1✔
31
  page: number
32
  per_page: number
33
  published: boolean
34
  projectId: string
35
}): Promise<APIResponse> => {
2✔
36
  return await api.get("", params)
2✔
37
}
2✔
38

39
const putDOIInfo = async (
1✔
40
  submissionId: string,
×
NEW
41
  doiFormDetails: Record<string, unknown>[]
×
42
): Promise<APIResponse> => {
×
43
  return await api.patch(`${submissionId}/doi`, doiFormDetails)
×
44
}
×
45

46
const putLinkedFolder = async (submissionId: string, folderName: string): Promise<APIResponse> => {
1✔
47
  return await api.patch(`${submissionId}/folder`, { linkedFolder: folderName })
×
48
}
×
49

50
const putRemsData = async (
1✔
51
  submissionId: string,
×
NEW
52
  remsData: Record<string, unknown>
×
53
): Promise<APIResponse> => {
×
54
  return await api.patch(`${submissionId}/rems`, remsData)
×
55
}
×
56

57
export default {
1✔
58
  createNewSubmission,
1✔
59
  getSubmissionById,
1✔
60
  patchSubmissionById,
1✔
61
  deleteSubmissionById,
1✔
62
  getSubmissions,
1✔
63
  putDOIInfo,
1✔
64
  putLinkedFolder,
1✔
65
  putRemsData,
1✔
66
}
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