-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add lazy loading for images in TalkListContent
- Loading branch information
Showing
3 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
//現在の設定を取得 | ||
// GET /api/v2/client/users/settings | ||
// -> { status: boolean, message: string, settings: Settings } | ||
import users from "../../../../../models/users.ts"; | ||
import userConfig from "../../../../../models/userConfig.ts"; | ||
export const handler = { | ||
async GET(req: Request, ctx: any) { | ||
if (!ctx.state.data.loggedIn) { | ||
return ctx.json({ status: false, message: "You are not logged in" }); | ||
} | ||
const userid = ctx.state.data.userid; | ||
const config = await userConfig.findOne({ userid: userid }); | ||
if (!config) { | ||
await userConfig.create({ userid: userid, addFriendById: true, allowOtherServerUsers: true }); | ||
} | ||
return new Response(JSON.stringify({ status: true, message: "Success", settings: { | ||
addFriendById: config?.addFriendById, | ||
allowOtherServerUsers: config?.allowOtherServerUsers, | ||
} }), { | ||
headers: { "Content-Type": "application/json" }, | ||
status: 200, | ||
}); | ||
}, | ||
} |