Fix all biome linter errors (#541)
This commit is contained in:
parent
f23c73f6a5
commit
e5d654bf41
46 changed files with 317 additions and 275 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
convertToCoreMessages,
|
||||
Message,
|
||||
type Message,
|
||||
StreamData,
|
||||
streamObject,
|
||||
streamText,
|
||||
|
|
@ -20,7 +20,7 @@ import {
|
|||
saveMessages,
|
||||
saveSuggestions,
|
||||
} from '@/lib/db/queries';
|
||||
import { Suggestion } from '@/lib/db/schema';
|
||||
import type { Suggestion } from '@/lib/db/schema';
|
||||
import {
|
||||
generateUUID,
|
||||
getMostRecentUserMessage,
|
||||
|
|
@ -118,7 +118,7 @@ export async function POST(request: Request) {
|
|||
}),
|
||||
execute: async ({ title }) => {
|
||||
const id = generateUUID();
|
||||
let draftText: string = '';
|
||||
let draftText = '';
|
||||
|
||||
streamingData.append({
|
||||
type: 'id',
|
||||
|
|
@ -158,7 +158,7 @@ export async function POST(request: Request) {
|
|||
|
||||
streamingData.append({ type: 'finish', content: '' });
|
||||
|
||||
if (session.user && session.user.id) {
|
||||
if (session.user?.id) {
|
||||
await saveDocument({
|
||||
id,
|
||||
title,
|
||||
|
|
@ -170,7 +170,7 @@ export async function POST(request: Request) {
|
|||
return {
|
||||
id,
|
||||
title,
|
||||
content: `A document was created and is now visible to the user.`,
|
||||
content: 'A document was created and is now visible to the user.',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
@ -192,7 +192,7 @@ export async function POST(request: Request) {
|
|||
}
|
||||
|
||||
const { content: currentContent } = document;
|
||||
let draftText: string = '';
|
||||
let draftText = '';
|
||||
|
||||
streamingData.append({
|
||||
type: 'clear',
|
||||
|
|
@ -236,7 +236,7 @@ export async function POST(request: Request) {
|
|||
|
||||
streamingData.append({ type: 'finish', content: '' });
|
||||
|
||||
if (session.user && session.user.id) {
|
||||
if (session.user?.id) {
|
||||
await saveDocument({
|
||||
id,
|
||||
title: document.title,
|
||||
|
|
@ -268,7 +268,7 @@ export async function POST(request: Request) {
|
|||
};
|
||||
}
|
||||
|
||||
let suggestions: Array<
|
||||
const suggestions: Array<
|
||||
Omit<Suggestion, 'userId' | 'createdAt' | 'documentCreatedAt'>
|
||||
> = [];
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ export async function POST(request: Request) {
|
|||
suggestions.push(suggestion);
|
||||
}
|
||||
|
||||
if (session.user && session.user.id) {
|
||||
if (session.user?.id) {
|
||||
const userId = session.user.id;
|
||||
|
||||
await saveSuggestions({
|
||||
|
|
@ -327,7 +327,7 @@ export async function POST(request: Request) {
|
|||
},
|
||||
},
|
||||
onFinish: async ({ responseMessages }) => {
|
||||
if (session.user && session.user.id) {
|
||||
if (session.user?.id) {
|
||||
try {
|
||||
const responseMessagesWithoutIncompleteToolCalls =
|
||||
sanitizeResponseMessages(responseMessages);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue