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