Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW-430: fix broken team selection #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions src/controllers/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@

try {
if (req.method === 'POST') {
// TODO: for MVP there is no approval process, so we are jumping straight to approve

Check warning on line 283 in src/controllers/publish.ts

View workflow job for this annotation

GitHub Actions / build (22.x)

Unexpected 'todo' comment: 'TODO: for MVP there is no approval...'
// once we have approval process, there will be an interstitial status while the dataset is waiting to
// be approved by a suitable member of the team
logger.debug('submitting dataset for publication');
Expand Down Expand Up @@ -1799,9 +1799,8 @@
organisations = await req.pubapi.getAllOrganisations();
teams = await req.pubapi.getAllTeams();

if (dataset.team_id) {
const datasetTeam = teams.find((team) => team.id === dataset.team_id)!;
values = { organisation: datasetTeam.organisation_id!, team: datasetTeam.id };
if (dataset.team.length > 0) {
values = { organisation: dataset.team[0].organisation_id, team: dataset.team[0].id };
}

if (req.method === 'POST') {
Expand Down
Loading