fixes
This commit is contained in:
parent
3871396339
commit
89f44aad7d
@ -44,7 +44,7 @@ export const sites = pgTable("sites", {
|
||||
text_color_hex: varchar("text_color_hex", { length: 6 }).default('ffffff').notNull(),
|
||||
title: text("title").default("The best blog in the world!"),
|
||||
subtitle: text("subtitle").default("Some extra info about the best blog in the world!"),
|
||||
domain: text("domain").default(null),
|
||||
domain: text("domain").$default(null),
|
||||
use_freebie: boolean("send_freebie").default(false),
|
||||
freebie_name: text("freebie_name").default(""),
|
||||
freebie_url: text("freebie_url").default(""),
|
||||
|
@ -105,6 +105,9 @@ export const authRoutes = (fastify, _, done) => {
|
||||
// });
|
||||
return;
|
||||
} catch (e) {
|
||||
if(e.message === "no_channel") {
|
||||
response.status(400).send("Your account does not have a youtube channel. Please make one.")
|
||||
}
|
||||
console.log(e);
|
||||
response.send({ success: false, message: e.message });
|
||||
return;
|
||||
|
@ -98,6 +98,9 @@ export async function getChannelInfo(access_token) {
|
||||
maxResults: 1
|
||||
}).then(res => res);
|
||||
|
||||
if(!channel.data.items[0]) {
|
||||
throw new Error("no_channel");
|
||||
}
|
||||
return channel.data.items[0];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user