Skip to content

Commit 2df4fad

Browse files
felixkobcursoragent
andcommitted
feat(accounts): accept optional slug on create/update
Forward an optional landing-page `slug` on accounts.create and accounts.update so apps can set/change the public landing-page URL (e.g. from a registration form). Backend validates + enforces per-app uniqueness. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 087fce3 commit 2df4fad

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/modules/accounts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ export function createAccountsModule(
8282
async create(params: {
8383
name: string;
8484
data?: Record<string, unknown>;
85+
slug?: string;
8586
}): Promise<Account> {
8687
return axios.post(base, params);
8788
},
8889

8990
async update(
9091
accountId: string,
91-
params: { name?: string; data?: Record<string, unknown> }
92+
params: { name?: string; data?: Record<string, unknown>; slug?: string }
9293
): Promise<Account> {
9394
return axios.patch(`${base}/${accountId}`, params);
9495
},

src/modules/accounts.types.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,16 @@ export interface AccountsModule {
142142
* @param slug - The account's URL slug.
143143
*/
144144
joinAccount(slug: string): Promise<AccountMembership>;
145-
/** Create a new account; the current user becomes its owner. */
146-
create(params: { name: string; data?: Record<string, unknown> }): Promise<Account>;
147-
/** Rename and/or update an account's custom fields (managers only). */
145+
/**
146+
* Create a new account; the current user becomes its owner.
147+
* @param params.slug - Optional public landing-page URL segment; auto-derived
148+
* from the name when omitted.
149+
*/
150+
create(params: { name: string; data?: Record<string, unknown>; slug?: string }): Promise<Account>;
151+
/** Rename, change the landing-page slug, and/or update an account's custom fields (managers only). */
148152
update(
149153
accountId: string,
150-
params: { name?: string; data?: Record<string, unknown> }
154+
params: { name?: string; data?: Record<string, unknown>; slug?: string }
151155
): Promise<Account>;
152156
/**
153157
* List an account's members (any active member).

0 commit comments

Comments
 (0)