Skip to content

Commit

Permalink
Use types for resource computed
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Jan 21, 2023
1 parent 345cc0d commit bc4599a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/web-app-files/src/components/Search/Preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { createLocationShares, createLocationSpaces } from '../../router'
import { basename, dirname } from 'path'
import { useAccessToken, useCapabilityShareJailEnabled, useStore } from 'web-pkg/src/composables'
import { defineComponent } from 'vue'
import { buildShareSpaceResource } from 'web-client/src/helpers'
import { buildShareSpaceResource, Resource } from 'web-client/src/helpers'
import { configurationManager } from 'web-pkg/src/configuration'
import { eventBus } from 'web-pkg/src/services/eventBus'
import { createFileRouteOptions } from 'web-pkg/src/helpers/router'
Expand All @@ -58,12 +58,13 @@ export default defineComponent({
setup(props) {
const store = useStore()
const previewData = ref()
const resource = computed(() => {
const resource = computed((): Resource => {
return {
...props.searchResult.data,
...(unref(previewData) && {
thumbnail: unref(previewData)
})
...(props.searchResult.data as Resource),
...(unref(previewData) &&
({
thumbnail: unref(previewData)
} as Resource))
}
})
return {
Expand Down

0 comments on commit bc4599a

Please sign in to comment.