(form: SquadForm)
| 1166 | }; |
| 1167 | |
| 1168 | const formToInput = (form: SquadForm): SharedSquadInput => ({ |
| 1169 | description: form.description, |
| 1170 | handle: form.handle, |
| 1171 | name: form.name, |
| 1172 | image: form.file, |
| 1173 | headerImage: form.header, |
| 1174 | memberPostingRole: form.memberPostingRole, |
| 1175 | memberInviteRole: form.memberInviteRole, |
| 1176 | categoryId: form.categoryId, |
| 1177 | moderationRequired: form.moderationRequired, |
| 1178 | postingMinReputation: form.postingMinReputation ?? null, |
| 1179 | isPrivate: form.status === PrivacyOption.Private, |
| 1180 | }); |
| 1181 | |
| 1182 | export async function createSquad(form: SquadForm): Promise<Squad> { |
| 1183 | const { description, ...inputData } = formToInput(form); |
no outgoing calls
no test coverage detected