Skip to content

Commit

Permalink
change some types for getters
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed Mar 11, 2024
1 parent 91d87b4 commit 4eefcb4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions frontend/src/components/object/ObjectFileDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ async function onVersionsChanged() {
onMounted(async () => {
const head = await objectStore.headObject(props.objectId);
const isPublic = head?.status === 204;
await permissionStore.fetchBucketPermissions({ userId: getUserId.value, objectPerms: true });
await objectStore.fetchObjects({ objectId: props.objectId, userId: getUserId.value, bucketPerms: true });
object.value = getObject.value(props.objectId);
const bucketId = object.value?.bucketId;
if (
!isPublic &&
head?.status !== 204 &&
(!object.value ||
!permissionStore.isObjectActionAllowed(object.value.id, getUserId.value, Permissions.READ, object.value.bucketId))
) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/object/ObjectVersion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const { getVersionsByObjectId } = storeToRefs(versionStore);
// State
const versionId = defineModel<string>('versionId');
const versions: Ref<Array<Version>> = computed((): any => getVersionsByObjectId.value(props.objectId));
const versions: Ref<Array<Version>> = computed(() => getVersionsByObjectId.value(props.objectId));
const tableData: Ref<Array<VersionDataSource>> = computed(() => {
return versions.value.map((v: Version, index, arr) => ({
...v,
Expand All @@ -58,8 +58,8 @@ const onVersionClick = (e: any) => {
versionId.value = e.data.id;
};
watch(props, async () => {
await userStore.fetchUsers({ userId: versions.value.map((x: Version) => x.createdBy) });
watch(props, () => {
userStore.fetchUsers({ userId: versions.value.map((x: Version) => x.createdBy) });
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/store/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const useUserStore = defineStore('user', () => {
() => (userId: string | undefined) => state.userSearch.value.find((x: User) => userId === x.userId)
),
// returns an array of Users corresponding to provided user IDs
getUsers: computed(() => (userIds: Array<string> | undefined) => {
getUsers: computed(() => (userIds?: Array<string>) => {
if (userIds && userIds.length) {
return state.userSearch.value.filter((x: User) => {
return userIds.includes(x.userId);
Expand Down

0 comments on commit 4eefcb4

Please sign in to comment.