MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / get

Method get

packages/hydrooj/src/handler/domain.ts:276–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

274
275class DomainJoinApplicationsHandler extends ManageHandler {
276 async get() {
277 const r = await domain.getRoles(this.domain);
278 const roles = r.map((role) => role._id).sort();
279 this.response.body.rolesWithText = roles.filter((i) => i !== 'guest').map((role) => [role, role]);
280 this.response.body.joinSettings = domain.getJoinSettings(this.domain, roles);
281 this.response.body.expirations = { ...domain.JOIN_EXPIRATION_RANGE };
282 if (!this.response.body.joinSettings) {
283 delete this.response.body.expirations[domain.JOIN_EXPIRATION_KEEP_CURRENT];
284 }
285 this.response.body.url_prefix = (this.domain.host || [])[0] || system.get('server.url');
286 if (!this.response.body.url_prefix.endsWith('/')) this.response.body.url_prefix += '/';
287 this.response.template = 'domain_join_applications.html';
288 }
289
290 @requireSudo
291 @post('method', Types.Range([domain.JOIN_METHOD_NONE, domain.JOIN_METHOD_ALL, domain.JOIN_METHOD_CODE]))

Callers

nothing calls this directly

Calls 3

getRolesMethod · 0.80
getJoinSettingsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected