update: lower message length limit
This commit is contained in:
@@ -28,10 +28,11 @@ export async function onRequestPost(context) {
|
||||
const { message } = await request.json();
|
||||
|
||||
if (!message) {
|
||||
return new Response(JSON.stringify({"error": "Missing message"}), {
|
||||
status: 400,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
});
|
||||
return createErrorResponse("Empty message", 400);
|
||||
}
|
||||
|
||||
if (message.length > 200) {
|
||||
return createErrorResponse("Message too long", 400);
|
||||
}
|
||||
|
||||
// Generate a unique ID for the message
|
||||
|
||||
@@ -5,7 +5,7 @@ const emit = defineEmits(['new-message']);
|
||||
const props = defineProps(['locked']);
|
||||
|
||||
const text = ref('');
|
||||
const maxLength = 1024;
|
||||
const maxLength = 200;
|
||||
|
||||
const remainingCharacters = computed(() => {
|
||||
return maxLength - text.value.length;
|
||||
|
||||
Reference in New Issue
Block a user