Fix set_random_project_color.rb
This commit is contained in:
parent
68e25ac8c7
commit
04607a7b7e
1 changed files with 2 additions and 2 deletions
|
@ -9,8 +9,8 @@ module Twenty::GraphQL::Mutation
|
|||
field :project, Twenty::GraphQL::Type::Project, null: true
|
||||
|
||||
def resolve(project_id:)
|
||||
project = Twenty::Project.find(project_id)
|
||||
project.update!(color: project.random_color)
|
||||
project = Twenty::Project.with_pk!(project_id)
|
||||
project.update(color: project.random_color)
|
||||
{errors: [], project:}
|
||||
rescue => ex
|
||||
{errors: [ex.message]}
|
||||
|
|
Loading…
Reference in a new issue