diff --git a/twenty-backend/lib/twenty-backend.rb b/twenty-backend/lib/twenty-backend.rb index e4e3fb2..d606571 100644 --- a/twenty-backend/lib/twenty-backend.rb +++ b/twenty-backend/lib/twenty-backend.rb @@ -20,7 +20,7 @@ module Twenty # @return [String] # Returns the default SQLite database. def self.default_database - @default_database ||= File.join(home, "20.sqlite") + @default_database ||= File.join(home, "database.sqlite") end ## diff --git a/twenty-backend/lib/twenty-backend/graphql/mutation/set_random_project_color.rb b/twenty-backend/lib/twenty-backend/graphql/mutation/set_random_project_color.rb index dbf1ef8..2eb6263 100644 --- a/twenty-backend/lib/twenty-backend/graphql/mutation/set_random_project_color.rb +++ b/twenty-backend/lib/twenty-backend/graphql/mutation/set_random_project_color.rb @@ -2,17 +2,16 @@ module Twenty::GraphQL::Mutation class SetRandomProjectColor < ::GraphQL::Schema::Mutation require_relative "../type/project" argument :project_id, Int, required: true - field :ok, Boolean, null: false + field :errors, [String], null: false field :project, Twenty::GraphQL::Type::Project, null: true def resolve(project_id:) - project = Twenty::Project.find_by(id: project_id) - project.color = project.send(:random_color) - project.save! - {ok: true, errors: [], project:} + project = Twenty::Project.find(project_id) + project.update!(color: project.random_color) + {errors: [], project:} rescue => ex - {ok: false, errors: [ex.message]} + {errors: [ex.message]} end end end diff --git a/twenty-backend/share/twenty-backend/schema.graphql b/twenty-backend/share/twenty-backend/schema.graphql index 9e045f4..5ad6abb 100644 --- a/twenty-backend/share/twenty-backend/schema.graphql +++ b/twenty-backend/share/twenty-backend/schema.graphql @@ -53,7 +53,6 @@ Autogenerated return type of SetRandomProjectColor. """ type SetRandomProjectColorPayload { errors: [String!]! - ok: Boolean! project: Project } diff --git a/twenty-frontend/src/js/types/schema.ts b/twenty-frontend/src/js/types/schema.ts index 6b858e5..f245397 100644 --- a/twenty-frontend/src/js/types/schema.ts +++ b/twenty-frontend/src/js/types/schema.ts @@ -108,7 +108,6 @@ export type QueryTasksArgs = { export type SetRandomProjectColorPayload = { __typename?: "SetRandomProjectColorPayload"; errors: Array; - ok: Scalars["Boolean"]["output"]; project?: Maybe; };