@rocapine/community-core 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hooks.js +1 -0
- package/lib/service.d.ts +4 -1
- package/lib/service.js +2 -2
- package/package.json +1 -1
package/lib/hooks.js
CHANGED
package/lib/service.d.ts
CHANGED
|
@@ -124,19 +124,22 @@ export declare function deleteOwnComment(cfg: ResolvedCommunityConfig, commentId
|
|
|
124
124
|
* signature and translated to the Edge Function's expected `avatarPath` body
|
|
125
125
|
* key at the call site below.
|
|
126
126
|
*/
|
|
127
|
+
/** `username` is the display name shown on posts; `handle` the @handle. All fields are moderated server-side. */
|
|
127
128
|
export type UpdateProfileInput = {
|
|
129
|
+
username?: string;
|
|
128
130
|
handle?: string;
|
|
129
131
|
bio?: string;
|
|
130
132
|
avatarUrl?: string;
|
|
131
133
|
};
|
|
132
134
|
export type UpdateProfileResult = {
|
|
133
135
|
status: "ok";
|
|
136
|
+
username: string | null;
|
|
134
137
|
handle: string | null;
|
|
135
138
|
bio: string | null;
|
|
136
139
|
avatarUrl: string | null;
|
|
137
140
|
} | {
|
|
138
141
|
status: "rejected";
|
|
139
|
-
field: "handle" | "bio" | "avatar";
|
|
142
|
+
field: "username" | "handle" | "bio" | "avatar";
|
|
140
143
|
reason?: string;
|
|
141
144
|
} | {
|
|
142
145
|
status: "error";
|
package/lib/service.js
CHANGED
|
@@ -472,9 +472,9 @@ async function deleteOwnComment(cfg, commentId) {
|
|
|
472
472
|
*/
|
|
473
473
|
async function updateProfile(cfg, input) {
|
|
474
474
|
const client = cfg.requireClient();
|
|
475
|
-
const { handle, bio, avatarUrl } = input;
|
|
475
|
+
const { username, handle, bio, avatarUrl } = input;
|
|
476
476
|
const { data, error } = await client.functions.invoke("update-profile", {
|
|
477
|
-
body: { handle, bio, avatarPath: avatarUrl },
|
|
477
|
+
body: { username, handle, bio, avatarPath: avatarUrl },
|
|
478
478
|
});
|
|
479
479
|
if (!error)
|
|
480
480
|
return data;
|
package/package.json
CHANGED