🐛 Serval bug fixes
This commit is contained in:
@@ -58,7 +58,7 @@ class StickerPackDetailScreen extends HookConsumerWidget {
|
|||||||
try {
|
try {
|
||||||
showLoadingModal(context);
|
showLoadingModal(context);
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
await apiClient.delete('/stickers/$id/content/${sticker.id}');
|
await apiClient.delete('/sphere/stickers/$id/content/${sticker.id}');
|
||||||
ref.invalidate(stickerPackContentProvider(id));
|
ref.invalidate(stickerPackContentProvider(id));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
@@ -297,7 +297,7 @@ class _StickerPackActionMenu extends HookConsumerWidget {
|
|||||||
).then((confirm) {
|
).then((confirm) {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
final client = ref.watch(apiClientProvider);
|
final client = ref.watch(apiClientProvider);
|
||||||
client.delete('/stickers/$packId');
|
client.delete('/sphere/stickers/$packId');
|
||||||
ref.invalidate(stickerPacksNotifierProvider);
|
ref.invalidate(stickerPacksNotifierProvider);
|
||||||
if (context.mounted) context.pop(true);
|
if (context.mounted) context.pop(true);
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ Future<SnSticker?> stickerPackSticker(
|
|||||||
if (query == null) return null;
|
if (query == null) return null;
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
final resp = await apiClient.get(
|
final resp = await apiClient.get(
|
||||||
'/stickers/${query.packId}/content/${query.id}',
|
'/sphere/stickers/${query.packId}/content/${query.id}',
|
||||||
);
|
);
|
||||||
if (resp.data == null) return null;
|
if (resp.data == null) return null;
|
||||||
return SnSticker.fromJson(resp.data);
|
return SnSticker.fromJson(resp.data);
|
||||||
@@ -379,8 +379,8 @@ class EditStickersScreen extends HookConsumerWidget {
|
|||||||
try {
|
try {
|
||||||
final resp = await apiClient.request(
|
final resp = await apiClient.request(
|
||||||
id == null
|
id == null
|
||||||
? '/stickers/$packId/content'
|
? '/sphere/stickers/$packId/content'
|
||||||
: '/stickers/$packId/content/$id',
|
: '/sphere/stickers/$packId/content/$id',
|
||||||
data: {'slug': slugController.text, 'image_id': imageController.text},
|
data: {'slug': slugController.text, 'image_id': imageController.text},
|
||||||
options: Options(method: id == null ? 'POST' : 'PATCH'),
|
options: Options(method: id == null ? 'POST' : 'PATCH'),
|
||||||
);
|
);
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
import 'package:dio/dio.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
@@ -48,7 +47,7 @@ class PostQuickReply extends HookConsumerWidget {
|
|||||||
'content': contentController.text,
|
'content': contentController.text,
|
||||||
'replied_post_id': parent.id,
|
'replied_post_id': parent.id,
|
||||||
},
|
},
|
||||||
options: Options(headers: {'X-Pub': currentPublisher.value?.name}),
|
queryParameters: {'pub': currentPublisher.value?.name},
|
||||||
);
|
);
|
||||||
contentController.clear();
|
contentController.clear();
|
||||||
onPosted?.call();
|
onPosted?.call();
|
||||||
|
Reference in New Issue
Block a user