Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ export const threadsApi = {
removeSubscriptions: () => $http('/api/threadnotifications', { method: 'DELETE' }),
disableNotifications: () => $http('/api/threadnotifications', { data: { enabled: false }, method: 'PUT' }),
enableNotifications: () => $http('/api/threadnotifications', { data: { enabled: true }, method: 'PUT' }),
viewed: threadId => $http2(`/api/threads/${threadId}/viewed`, { method: 'POST' })
viewed: threadId => $http2(`/api/threads/${threadId}/viewed`, { method: 'POST' }),
byUser: params => $http2(`/api/threads/user/${params.username}`, { params }),
}

export const postsApi = {
Expand All @@ -147,8 +148,7 @@ export const postsApi = {
unlock: postId => $http(`/api/posts/${postId}/unlock`, { method: 'POST'}),
byThread: params => $http2('/api/posts', { params }),
find: id => $http(`/api/posts/${id}`),
byUser: params => $http(`/api/posts/user/${params.username}`, { params }),
startedByUser: params => $http(`/api/posts/user/${params.username}/started`, { params }),
byUser: params => $http2(`/api/posts/user/${params.username}`, { params }),
slugToPostId: slug => $http(`/api/posts/${slug}/id`),
postSearch: params => $http('/api/search/posts', { params }),
byNewbie: params => $http('/api/posts/patrol', { params }),
Expand Down
10 changes: 6 additions & 4 deletions src/components/users/UserPosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<script>
import humanDate from '@/composables/filters/humanDate'
import { reactive, toRefs, computed, inject, watch } from 'vue'
import { postsApi } from '@/api'
import { postsApi, threadsApi } from '@/api'
import { PreferencesStore, localStoragePrefs } from '@/composables/stores/prefs'
import { useRoute, useRouter } from 'vue-router'
import SimplePagination from '@/components/layout/SimplePagination.vue'
Expand All @@ -120,7 +120,7 @@ export default {
field: to.query.field,
desc: to.query.desc
}
if (vm.threads) postsApi.startedByUser(params).then(d => vm.postData = d)
if (vm.threads) threadsApi.byUser(params).then(d => vm.postData = d)
else postsApi.byUser(params)
.then(d => {
vm.postData = d
Expand All @@ -136,7 +136,7 @@ export default {
field: to.query.field,
desc: to.query.desc
}
if (this.threads) postsApi.startedByUser(params).then(d => this.postData = d)
if (this.threads) threadsApi.byUser(params).then(d => this.postData = d)
else postsApi.byUser(params)
.then(d => {
this.postData = d
Expand All @@ -163,7 +163,7 @@ export default {
field: $route.query.field,
desc: $route.query.desc
}
if (v.threads) postsApi.startedByUser(params).then(d => v.postData = d)
if (v.threads) threadsApi.byUser(params).then(d => v.postData = d)
else postsApi.byUser(params).then(d => v.postData = d)
}

Expand Down Expand Up @@ -282,6 +282,8 @@ export default {
}
}

.pagination-wrap { margin-top: 1rem; }

.table-actions {
display: flex;
align-items: center;
Expand Down