mirror of
https://github.com/outline/outline.git
synced 2026-11-26 23:50:14 +03:00
Remove avatars.ts and avatars.test.ts files and update teamCreator.ts
This commit is contained in:
1 parent
a3910ce6d1
commit
26be6dcf98
3 files changed
+3
-31
No files matched your search
@@ -3,7 +3,6 @@ import slugify from "slugify";
|
||||
import { RESERVED_SUBDOMAINS } from "@shared/utils/domains";
|
||||
import { traceFunction } from "@server/logging/tracing";
|
||||
import { Team, Event } from "@server/models";
|
||||
import { generateAvatarUrl } from "@server/utils/avatars";
|
||||
|
||||
type Props = {
|
||||
/** The displayed name of the team */
|
||||
@@ -36,13 +35,10 @@ async function teamCreator({
|
||||
ip,
|
||||
transaction,
|
||||
}: Props): Promise<Team> {
|
||||
// If the service did not provide a logo/avatar then we attempt to generate
|
||||
// one via ClearBit, or fallback to colored initials in worst case scenario
|
||||
// If the service did not provide a logo/avatar then we'll use the default
|
||||
// avatar generation mechanism (colored initials)
|
||||
if (!avatarUrl || !avatarUrl.startsWith("http")) {
|
||||
avatarUrl = await generateAvatarUrl({
|
||||
domain,
|
||||
id: subdomain,
|
||||
});
|
||||
avatarUrl = null;
|
||||
}
|
||||
|
||||
const team = await Team.create(
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { generateAvatarUrl } from "./avatars";
|
||||
|
||||
it("should return null as Clearbit API is discontinued", async () => {
|
||||
const url = await generateAvatarUrl({
|
||||
id: "google",
|
||||
domain: "google.com",
|
||||
});
|
||||
expect(url).toBe(null);
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
import crypto from "crypto";
|
||||
import fetch from "./fetch";
|
||||
|
||||
export async function generateAvatarUrl({
|
||||
id,
|
||||
domain,
|
||||
}: {
|
||||
id: string;
|
||||
domain?: string;
|
||||
}) {
|
||||
// Clearbit API is being discontinued, so we're removing this functionality
|
||||
// and always returning null to allow the application to fall back to its
|
||||
// default avatar generation mechanism
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user