Skip to content

Commit

Permalink
fix: add misisng comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
NishaSharma14 committed Nov 16, 2022
1 parent b3ca121 commit 1c85a93
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions app/Actions/Project/UpdateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,30 @@ public function detachAuthor(Project $project, $author_id)
);
}

/**
* Update existing Contributor type for a given author in a project.
*
* @param \App\Models\Project $project
* @param string $authorId
* @param string $role
* @return void
*/
public function updateContributorType(Project $project, $author_id, $role)
{
$project->authors()->updateExistingPivot($author_id, [
'contributor_type' => $role,
]);
}

/**
* Attach citations to a project.
*
* @param \App\Models\Project $project
* @param \App\Models\User $user
* @param array $citations
* @return void
*/

public function syncCitations(Project $project, $citations, $user)
{
$citations_map = [];
Expand All @@ -182,10 +206,6 @@ public function syncCitations(Project $project, $citations, $user)
$project->citations()->sync(
$citations_map
);

// $project->citations()->sync(
// $citations, ['user' => $user->get('id')]
// );
}

/**
Expand Down

0 comments on commit 1c85a93

Please # to comment.