Fixed follow list view pagination
ci/woodpecker/push/ociImagePush Pipeline is running Details

This commit is contained in:
Natty 2024-03-06 16:09:31 +01:00
parent 236502ad05
commit 66ce0de3fa
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 29 additions and 17 deletions

View File

@ -22,33 +22,45 @@
</template>
<script lang="ts" setup>
import { computed } from "vue";
import MkUserInfo from "@/components/MkUserInfo.vue";
import { endpoints, packed } from "magnetar-common";
import MagPagination, { Paging } from "@/components/MagPagination.vue";
import { reactive, watch } from "vue";
const props = defineProps<{
user: packed.PackUserBase;
type: "following" | "followers";
}>();
const followingPagination: Paging = {
endpoint: endpoints.GetFollowingById,
limit: 20,
pathParams: computed(() => ({
id: props.user.id,
})),
params: {},
};
const followingPagination: Paging<typeof endpoints.GetFollowingById> = reactive(
{
endpoint: endpoints.GetFollowingById,
limit: 20,
pathParams: {
id: props.user.id,
},
params: {},
}
);
const followersPagination: Paging = {
endpoint: endpoints.GetFollowersById,
limit: 20,
pathParams: computed(() => ({
id: props.user.id,
})),
params: {},
};
const followersPagination: Paging<typeof endpoints.GetFollowersById> = reactive(
{
endpoint: endpoints.GetFollowersById,
limit: 20,
pathParams: {
id: props.user.id,
},
params: {},
}
);
watch(
() => props.user.id,
(val) => {
followingPagination.pathParams.id = val;
followersPagination.pathParams.id = val;
}
);
</script>
<style lang="scss" scoped>