Sorting error: NoSuchField
Getting this error when trying to sort documents that have been uploaded by users:
Function that results in this error:
UserUpload resource:
UserUploads.Meta resource:
(MatchError) no match of right hand side value: {:error, %Ash.Error.Invalid{errors: [%Ash.Error.Query.NoSuchField{resource: MyApp.Ash.Accounts.UserUpload, field: "uploaded_file_name", splode: Ash.Error, bread_crumbs: [], vars: [], path: [:sort], stacktrace: #Splode.Stacktrace<>, class: :invalid}]}}(MatchError) no match of right hand side value: {:error, %Ash.Error.Invalid{errors: [%Ash.Error.Query.NoSuchField{resource: MyApp.Ash.Accounts.UserUpload, field: "uploaded_file_name", splode: Ash.Error, bread_crumbs: [], vars: [], path: [:sort], stacktrace: #Splode.Stacktrace<>, class: :invalid}]}}Function that results in this error:
{:ok, %{results: documents, count: count}} =
UserUpload.by_ids(
%{organization_ids: org_ids},
query: [sort_input: "meta.uploaded_file_name"],
page: [limit: pagination.limit, offset: pagination.offset, count: true]
){:ok, %{results: documents, count: count}} =
UserUpload.by_ids(
%{organization_ids: org_ids},
query: [sort_input: "meta.uploaded_file_name"],
page: [limit: pagination.limit, offset: pagination.offset, count: true]
)UserUpload resource:
attributes do
uuid_primary_key :id
attribute :document, :string, public?: true
attribute :meta, UserUploads.Meta, public?: true
create_timestamp :inserted_at
update_timestamp :updated_at
endattributes do
uuid_primary_key :id
attribute :document, :string, public?: true
attribute :meta, UserUploads.Meta, public?: true
create_timestamp :inserted_at
update_timestamp :updated_at
endUserUploads.Meta resource:
attributes do
attribute :uploaded_file_name, :string do
public? true
end
endattributes do
attribute :uploaded_file_name, :string do
public? true
end
end