@@ -13,20 +13,22 @@ const bodySchema = z.object({
1313 name : z . string ( ) . trim ( ) . min ( 1 ) ,
1414 domain : z . string ( ) . trim ( ) . min ( 1 ) ,
1515 source : z . string ( ) . trim ( ) . min ( 1 ) ,
16+ logo : z . string ( ) . trim ( ) . min ( 1 ) . optional ( ) ,
1617} )
1718
1819export async function createOrganization ( req : Request , res : Response ) : Promise < void > {
19- const { name, domain, source } = validateOrThrow ( bodySchema , req . body )
20+ const { name, domain, source, logo } = validateOrThrow ( bodySchema , req . body )
2021
2122 const qx = optionsQx ( req )
2223
2324 let organizationId : string | undefined
2425
2526 await qx . tx ( async ( tx ) => {
26- const orgSource = OrganizationAttributeSource . CUSTOM
27+ const orgSource = OrganizationAttributeSource . LFX_SERVE
2728
2829 organizationId = await findOrCreateOrganization ( tx , orgSource , {
2930 displayName : name ,
31+ logo,
3032 identities : [
3133 {
3234 value : domain ,
@@ -59,5 +61,5 @@ export async function createOrganization(req: Request, res: Response): Promise<v
5961 )
6062 } )
6163
62- created ( res , { id : organizationId , name } )
64+ created ( res , { id : organizationId , name, logo } )
6365}
0 commit comments