draft-update から update-draft に
admin/emoji/list-draft を追加 Update MkPagination.vue Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
parent
f382520593
commit
53d250dddf
8 changed files with 126 additions and 24 deletions
|
|
@ -45,7 +45,7 @@ const emojisDraftPaginationComponent = shallowRef<InstanceType<typeof MkPaginati
|
|||
const query = ref(null);
|
||||
|
||||
const paginationDraft = {
|
||||
endpoint: 'emoji-drafts' as const,
|
||||
endpoint: 'admin/emoji/list-draft' as const,
|
||||
limit: 30,
|
||||
params: computed(() => ({
|
||||
query: (query.value && query.value !== '') ? query.value : null,
|
||||
|
|
@ -81,7 +81,7 @@ async function undrafted(emoji) {
|
|||
});
|
||||
if (canceled) return;
|
||||
|
||||
await os.api('admin/emoji/draft-update', {
|
||||
await os.api('admin/emoji/update-draft', {
|
||||
id: emoji.id,
|
||||
fileId: emoji.fileId,
|
||||
name: emoji.name,
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ async function done() {
|
|||
|
||||
if (props.emoji) {
|
||||
if (isDraftEdit) {
|
||||
await os.apiWithDialog('admin/emoji/draft-update', {
|
||||
await os.apiWithDialog('admin/emoji/update-draft', {
|
||||
id: props.emoji.id,
|
||||
...params,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -201,9 +201,6 @@ async function init(): Promise<void> {
|
|||
...params,
|
||||
limit: props.pagination.limit ?? 10,
|
||||
}).then(res => {
|
||||
if (props.pagination.endpoint === 'emoji-drafts') {
|
||||
res = res.emojis;
|
||||
}
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
const item = res[i];
|
||||
if (i === 3) item._shouldInsertAd_ = true;
|
||||
|
|
@ -242,9 +239,6 @@ const fetchMore = async (): Promise<void> => {
|
|||
untilId: Array.from(items.value.keys()).at(-1),
|
||||
}),
|
||||
}).then(res => {
|
||||
if (props.pagination.endpoint === 'emoji-drafts') {
|
||||
res = res.emojis;
|
||||
}
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
const item = res[i];
|
||||
if (i === 10) item._shouldInsertAd_ = true;
|
||||
|
|
@ -309,9 +303,6 @@ const fetchMoreAhead = async (): Promise<void> => {
|
|||
sinceId: Array.from(items.value.keys()).at(-1),
|
||||
}),
|
||||
}).then(res => {
|
||||
if (props.pagination.endpoint === 'emoji-drafts') {
|
||||
res = res.emojis;
|
||||
}
|
||||
if (res.length === 0) {
|
||||
items.value = concatMapWithArray(items.value, res);
|
||||
more.value = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue