View | Details | Raw Unified | Return to bug 30855
Collapse All | Expand All

(-)a/Koha/REST/V1/ImportRecordMatches.pm (-2 / +2 lines)
Lines 33-39 use Try::Tiny; Link Here
33
33
34
Method that handles unselecting all chosen matches for an import record
34
Method that handles unselecting all chosen matches for an import record
35
35
36
DELETE /api/v1/import/{import_batch_id}/records/{import_record_id}/matches/chosen
36
DELETE /api/v1/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen
37
37
38
=cut
38
=cut
39
39
Lines 63-69 sub unset_chosen { Link Here
63
63
64
Method that handles modifying if a Koha::Import::Record::Match object has been chosen for overlay
64
Method that handles modifying if a Koha::Import::Record::Match object has been chosen for overlay
65
65
66
PUT /api/v1/import/{import_batch_id}/records/{import_record_id}/matches/chosen
66
PUT /api/v1/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen
67
67
68
Body should contain the condidate_match_id to chose
68
Body should contain the condidate_match_id to chose
69
69
(-)a/api/v1/swagger/paths/import_record_matches.yaml (-1 / +1 lines)
Lines 1-5 Link Here
1
---
1
---
2
"/import/{import_batch_id}/records/{import_record_id}/matches/chosen":
2
"/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen":
3
  put:
3
  put:
4
    x-mojo-to: ImportRecordMatches#set_chosen
4
    x-mojo-to: ImportRecordMatches#set_chosen
5
    operationId: setChosen
5
    operationId: setChosen
(-)a/api/v1/swagger/swagger.yaml (-2 / +2 lines)
Lines 143-150 paths: Link Here
143
    $ref: "./paths/ill_backends.yaml#/~1ill_backends~1{ill_backend_id}"
143
    $ref: "./paths/ill_backends.yaml#/~1ill_backends~1{ill_backend_id}"
144
  /illrequests:
144
  /illrequests:
145
    $ref: ./paths/illrequests.yaml#/~1illrequests
145
    $ref: ./paths/illrequests.yaml#/~1illrequests
146
  "/import/{import_batch_id}/records/{import_record_id}/matches/chosen":
146
  "/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen":
147
    $ref: "./paths/import_record_matches.yaml#/~1import~1{import_batch_id}~1records~1{import_record_id}~1matches~1chosen"
147
    $ref: "./paths/import_batches.yaml#/~1import_batches~1{import_batch_id}~1records~1{import_record_id}~1matches~1chosen"
148
  /import_batch_profiles:
148
  /import_batch_profiles:
149
    $ref: ./paths/import_batch_profiles.yaml#/~1import_batch_profiles
149
    $ref: ./paths/import_batch_profiles.yaml#/~1import_batch_profiles
150
  "/import_batch_profiles/{import_batch_profile_id}":
150
  "/import_batch_profiles/{import_batch_profile_id}":
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (-1 / +1 lines)
Lines 621-627 Link Here
621
                    apidata = JSON.stringify({ candidate_match_id: $(this).val() });
621
                    apidata = JSON.stringify({ candidate_match_id: $(this).val() });
622
                }
622
                }
623
                $.ajax({
623
                $.ajax({
624
                    url: '/api/v1/import/[% import_batch_id | html %]/records/'+$(this).data('import_record_id')+'/matches/chosen',
624
                    url: '/api/v1/import_batches/[% import_batch_id | html %]/records/'+$(this).data('import_record_id')+'/matches/chosen',
625
                    method: apimethod,
625
                    method: apimethod,
626
                    data: apidata,
626
                    data: apidata,
627
                    contentType: 'application/json'
627
                    contentType: 'application/json'
(-)a/t/db_dependent/api/v1/import_record_matches.t (-5 / +4 lines)
Lines 67-73 subtest 'import record matches tests' => sub { Link Here
67
67
68
    # Unauthorized attempt to update
68
    # Unauthorized attempt to update
69
    my $tx = $t->ua->build_tx(
69
    my $tx = $t->ua->build_tx(
70
      PUT => "/api/v1/import/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen"=>
70
      PUT => "/api/v1/import_batches/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen"=>
71
      json => {
71
      json => {
72
          candidate_match_id => $match_1->candidate_match_id
72
          candidate_match_id => $match_1->candidate_match_id
73
      }
73
      }
Lines 79-85 subtest 'import record matches tests' => sub { Link Here
79
79
80
    # Invalid attempt to allow match on a non-existent record
80
    # Invalid attempt to allow match on a non-existent record
81
    $tx = $t->ua->build_tx(
81
    $tx = $t->ua->build_tx(
82
      PUT => "/api/v1/import/".$del_import_batch_id."/records/".$del_match_id."/matches/chosen" =>
82
      PUT => "/api/v1/import_batches/".$del_import_batch_id."/records/".$del_match_id."/matches/chosen" =>
83
      json => {
83
      json => {
84
          candidate_match_id => $match_1->candidate_match_id
84
          candidate_match_id => $match_1->candidate_match_id
85
      }
85
      }
Lines 94-100 subtest 'import record matches tests' => sub { Link Here
94
94
95
    # Valid, authorised update
95
    # Valid, authorised update
96
    $tx = $t->ua->build_tx(
96
    $tx = $t->ua->build_tx(
97
      PUT => "/api/v1/import/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen" =>
97
      PUT => "/api/v1/import_batches/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen" =>
98
      json => {
98
      json => {
99
          candidate_match_id => $match_1->candidate_match_id
99
          candidate_match_id => $match_1->candidate_match_id
100
      }
100
      }
Lines 111-117 subtest 'import record matches tests' => sub { Link Here
111
111
112
    # Valid unsetting
112
    # Valid unsetting
113
    $tx = $t->ua->build_tx(
113
    $tx = $t->ua->build_tx(
114
      DELETE => "/api/v1/import/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen" =>
114
      DELETE => "/api/v1/import_batches/".$match_1->import_record->import_batch_id."/records/".$match_1->import_record_id."/matches/chosen" =>
115
      json => {
115
      json => {
116
      }
116
      }
117
    );
117
    );
118
- 

Return to bug 30855