Fix profile list not loading more

This commit is contained in:
MartinBraquet
2026-01-28 23:26:59 +01:00
parent 237ed0b5bf
commit 5b43382fc7
6 changed files with 16 additions and 13 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.compassconnections.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 26
versionName "1.3.1"
versionCode 28
versionName "1.4.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

View File

@@ -1,7 +1,7 @@
{
"name": "@compass/api",
"description": "Backend API endpoints",
"version": "1.3.0",
"version": "1.3.1",
"private": true,
"scripts": {
"watch:serve": "tsx watch src/serve.ts",

View File

@@ -2,7 +2,6 @@ import {type APIHandler} from 'api/helpers/endpoint'
import {convertRow} from 'shared/profiles/supabase'
import {createSupabaseDirectClient, pgp} from 'shared/supabase/init'
import {from, join, leftJoin, limit, orderBy, renderSql, select, where,} from 'shared/supabase/sql-builder'
import {MIN_BIO_LENGTH} from "common/constants";
import {compact} from "lodash";
import {OptionTableKey} from "common/profiles/constants";
@@ -119,6 +118,7 @@ export const loadProfiles = async (props: profileQueryType) => {
GROUP BY profile_${label}.profile_id
) profile_${label} ON profile_${label}.profile_id = profiles.id`
}
const interestsJoin = getManyToManyJoin('interests')
const causesJoin = getManyToManyJoin('causes')
const workJoin = getManyToManyJoin('work')
@@ -292,7 +292,12 @@ export const loadProfiles = async (props: profileQueryType) => {
skipId && where(`profiles.user_id != $(skipId)`, {skipId}),
!shortBio && where(`bio_length >= ${MIN_BIO_LENGTH}`, {MIN_BIO_LENGTH}),
!shortBio && where(
`bio_length >= ${100}
OR array_length(profile_work.work, 1) > 0
OR array_length(profile_interests.interests, 1) > 0
OR occupation_title IS NOT NULL
`),
lastModificationWithin && where(`last_modification_time >= NOW() - INTERVAL $(lastModificationWithin)`, {lastModificationWithin}),
]

View File

@@ -86,7 +86,7 @@ export const initialFilters: Partial<FilterFields> = {
religion: undefined,
mbti: undefined,
pref_gender: undefined,
shortBio: true,
shortBio: undefined,
drinks_min: undefined,
drinks_max: undefined,
orderBy: 'created_time',

View File

@@ -23,7 +23,7 @@ export function RelationshipFilterText(props: {
)
}
const convertedRelationships = relationship.map((r) =>
const convertedRelationships = relationship?.map((r) =>
t(`profile.relationship.${r}`, convertRelationshipType(r))
)

View File

@@ -116,9 +116,9 @@ function ProfilePreview(props: {
const seekingGenderText = getSeekingGenderText(profile, t)
if (!profile.work?.length && !profile.occupation_title && !profile.interests?.length && (profile.bio_length || 0) < 100) {
return null
}
// if (!profile.work?.length && !profile.occupation_title && !profile.interests?.length && (profile.bio_length || 0) < 100) {
// return null
// }
return (
<Link
@@ -173,9 +173,8 @@ function ProfilePreview(props: {
<div className="line-clamp-4">
{/*TODO: fix nested <a> links warning (one from Link above, one from link in bio below)*/}
<Content className="w-full" content={bio}/>
{/*<Col>*/}
{seekingGenderText && <p>{seekingGenderText}.</p>}
{!!profile.work?.length && <p>
{(!!profile.work?.length || profile.occupation_title) && <p>
{t("profile.optional.category.work", "Work")}:{" "}
{profile.occupation_title && profile.occupation_title + ", "}
{profile.work?.slice(0, 3).map(id => choicesIdsToLabels['work'][id]).join(', ')}
@@ -185,7 +184,6 @@ function ProfilePreview(props: {
{t("profile.optional.interests", "Interests")}:{" "}
{profile.interests?.map(id => choicesIdsToLabels['interests'][id]).join(', ')}
</p>}
{/*</Col>*/}
</div>
</div>
</div>