glitch-soc/mastodon

View on GitHub
app/javascript/flavours/glitch/models/suggestion.ts

Summary

Maintainability
A
40 mins
Test Coverage
import type { ApiSuggestionJSON } from 'flavours/glitch/api_types/suggestions';

export interface Suggestion extends Omit<ApiSuggestionJSON, 'account'> {
  account_id: string;
}

export const createSuggestion = (
  serverJSON: ApiSuggestionJSON,
): Suggestion => ({
  sources: serverJSON.sources,
  account_id: serverJSON.account.id,
});