Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/breeding-insight/dao/GermplasmDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as api from "@/util/api";
import {PaginationQuery} from "@/breeding-insight/model/PaginationQuery";
import {Result, ResultGenerator} from "@/breeding-insight/model/Result";
import {Germplasm} from "@/breeding-insight/brapi/model/germplasm";
import {ListType} from "@/util/ListType";

export class GermplasmDAO {

Expand All @@ -29,7 +30,7 @@ export class GermplasmDAO {
config.url = `${process.env.VUE_APP_BI_API_V1_PATH}/programs/${programId}/brapi/v2/lists`;
config.method = 'get';
config.programId = programId;
config.params = {};
config.params = {listType: ListType.Germplasm};
if (paginationQuery.page) config.params.page = paginationQuery.page - 1;
if (paginationQuery.pageSize) config.params.pageSize = paginationQuery.pageSize;

Expand Down
20 changes: 20 additions & 0 deletions src/util/ListType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export enum ListType {
Germplasm = "germplasm",
}
3 changes: 2 additions & 1 deletion src/views/germplasm/GermplasmLists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {GermplasmListSort, GermplasmListSortField} from "@/breeding-insight/mode
import {PaginationController} from "@/breeding-insight/model/view_models/PaginationController";
import {BiResponse} from "@/breeding-insight/model/BiResponse";
import {BrAPIService, BrAPIType} from "@/breeding-insight/service/BrAPIService";
import {ListType} from "@/util/ListType";
@Component({
components: {
GermplasmListsTable
Expand All @@ -44,7 +45,7 @@ export default class GermplasmLists extends ProgramsBase {
private germplasmListFetch: (programId: string, sort: GermplasmListSort, paginationController: PaginationController) => ((filters: any) => Promise<BiResponse>) =
function (programId: string, sort: GermplasmListSort, paginationController: PaginationController) {
return function (filters: any) {
filters.type='germplasm';
filters.listType=ListType.Germplasm;
return BrAPIService.get<GermplasmListSortField>(
BrAPIType.LIST,
programId,
Expand Down