mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Return subscription icon proxy url in the list subscriptions api response
This commit is contained in:
parent
d42d4ace98
commit
6220d5d4af
4 changed files with 9 additions and 1 deletions
|
|
@ -1987,6 +1987,7 @@ export type Subscription = {
|
|||
__typename?: 'Subscription';
|
||||
createdAt: Scalars['Date'];
|
||||
description?: Maybe<Scalars['String']>;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
id: Scalars['ID'];
|
||||
name: Scalars['String'];
|
||||
newsletterEmail: Scalars['String'];
|
||||
|
|
@ -4368,6 +4369,7 @@ export type SubscribeSuccessResolvers<ContextType = ResolverContext, ParentType
|
|||
export type SubscriptionResolvers<ContextType = ResolverContext, ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']> = {
|
||||
createdAt?: SubscriptionResolver<ResolversTypes['Date'], "createdAt", ParentType, ContextType>;
|
||||
description?: SubscriptionResolver<Maybe<ResolversTypes['String']>, "description", ParentType, ContextType>;
|
||||
icon?: SubscriptionResolver<Maybe<ResolversTypes['String']>, "icon", ParentType, ContextType>;
|
||||
id?: SubscriptionResolver<ResolversTypes['ID'], "id", ParentType, ContextType>;
|
||||
name?: SubscriptionResolver<ResolversTypes['String'], "name", ParentType, ContextType>;
|
||||
newsletterEmail?: SubscriptionResolver<ResolversTypes['String'], "newsletterEmail", ParentType, ContextType>;
|
||||
|
|
|
|||
|
|
@ -1485,6 +1485,7 @@ type SubscribeSuccess {
|
|||
type Subscription {
|
||||
createdAt: Date!
|
||||
description: String
|
||||
icon: String
|
||||
id: ID!
|
||||
name: String!
|
||||
newsletterEmail: String!
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import { User } from '../../entity/user'
|
|||
import { Subscription } from '../../entity/subscription'
|
||||
import { getSubscribeHandler, unsubscribe } from '../../services/subscriptions'
|
||||
import { ILike } from 'typeorm'
|
||||
import { createImageProxyUrl } from '../../utils/imageproxy'
|
||||
|
||||
export const subscriptionsResolver = authorized<
|
||||
SubscriptionsSuccess,
|
||||
|
|
@ -57,7 +58,10 @@ export const subscriptionsResolver = authorized<
|
|||
})
|
||||
|
||||
return {
|
||||
subscriptions,
|
||||
subscriptions: subscriptions.map((s) => ({
|
||||
...s,
|
||||
icon: s.icon && createImageProxyUrl(s.icon, 260, 260),
|
||||
})),
|
||||
}
|
||||
} catch (error) {
|
||||
log.error(error)
|
||||
|
|
|
|||
|
|
@ -1530,6 +1530,7 @@ const schema = gql`
|
|||
status: SubscriptionStatus!
|
||||
unsubscribeMailTo: String
|
||||
unsubscribeHttpUrl: String
|
||||
icon: String
|
||||
createdAt: Date!
|
||||
updatedAt: Date!
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue