Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
Remove creator from SiteView and Site parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisMarotta authored and Marcin Wojnarowski committed Apr 30, 2022
1 parent 7c407bb commit 746f1fd
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
2 changes: 1 addition & 1 deletion lib/src/v3/models/source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Site with _$Site {
required String name,
String? sidebar,
String? description,
required int creatorId,
int? creatorId, //Creator ID has been removed from the Site parameters
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand Down
25 changes: 13 additions & 12 deletions lib/src/v3/models/source.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ class _$SiteTearOff {
required String name,
String? sidebar,
String? description,
required int creatorId,
int? creatorId,
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand Down Expand Up @@ -1212,7 +1212,8 @@ mixin _$Site {
String get name => throw _privateConstructorUsedError;
String? get sidebar => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
int get creatorId => throw _privateConstructorUsedError;
int? get creatorId =>
throw _privateConstructorUsedError; //Creator ID has been removed from the Site parameters
DateTime get published => throw _privateConstructorUsedError;
DateTime? get updated => throw _privateConstructorUsedError;
bool get enableDownvotes => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -1242,7 +1243,7 @@ abstract class $SiteCopyWith<$Res> {
String name,
String? sidebar,
String? description,
int creatorId,
int? creatorId,
DateTime published,
DateTime? updated,
bool enableDownvotes,
Expand Down Expand Up @@ -1309,7 +1310,7 @@ class _$SiteCopyWithImpl<$Res> implements $SiteCopyWith<$Res> {
creatorId: creatorId == freezed
? _value.creatorId
: creatorId // ignore: cast_nullable_to_non_nullable
as int,
as int?,
published: published == freezed
? _value.published
: published // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1380,7 +1381,7 @@ abstract class _$SiteCopyWith<$Res> implements $SiteCopyWith<$Res> {
String name,
String? sidebar,
String? description,
int creatorId,
int? creatorId,
DateTime published,
DateTime? updated,
bool enableDownvotes,
Expand Down Expand Up @@ -1448,7 +1449,7 @@ class __$SiteCopyWithImpl<$Res> extends _$SiteCopyWithImpl<$Res>
creatorId: creatorId == freezed
? _value.creatorId
: creatorId // ignore: cast_nullable_to_non_nullable
as int,
as int?,
published: published == freezed
? _value.published
: published // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1520,7 +1521,7 @@ class _$_Site extends _Site {
required this.name,
this.sidebar,
this.description,
required this.creatorId,
this.creatorId,
required this.published,
this.updated,
required this.enableDownvotes,
Expand Down Expand Up @@ -1548,8 +1549,8 @@ class _$_Site extends _Site {
@override
final String? description;
@override
final int creatorId;
@override
final int? creatorId;
@override //Creator ID has been removed from the Site parameters
final DateTime published;
@override
final DateTime? updated;
Expand Down Expand Up @@ -1661,7 +1662,7 @@ abstract class _Site extends Site {
required String name,
String? sidebar,
String? description,
required int creatorId,
int? creatorId,
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand Down Expand Up @@ -1689,8 +1690,8 @@ abstract class _Site extends Site {
@override
String? get description;
@override
int get creatorId;
@override
int? get creatorId;
@override //Creator ID has been removed from the Site parameters
DateTime get published;
@override
DateTime? get updated;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/v3/models/source.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/v3/models/views.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SiteView with _$SiteView {
@JsonSerializable(fieldRename: FieldRename.snake)
const factory SiteView({
required Site site,
required PersonSafe creator,
PersonSafe? creator,
required SiteAggregates counts,
required String instanceHost,
}) = _SiteView;
Expand Down
32 changes: 18 additions & 14 deletions lib/src/v3/models/views.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ class _$SiteViewTearOff {

_SiteView call(
{required Site site,
required PersonSafe creator,
PersonSafe? creator,
required SiteAggregates counts,
required String instanceHost}) {
return _SiteView(
Expand All @@ -1038,7 +1038,7 @@ const $SiteView = _$SiteViewTearOff();
/// @nodoc
mixin _$SiteView {
Site get site => throw _privateConstructorUsedError;
PersonSafe get creator => throw _privateConstructorUsedError;
PersonSafe? get creator => throw _privateConstructorUsedError;
SiteAggregates get counts => throw _privateConstructorUsedError;
String get instanceHost => throw _privateConstructorUsedError;

Expand All @@ -1054,12 +1054,12 @@ abstract class $SiteViewCopyWith<$Res> {
_$SiteViewCopyWithImpl<$Res>;
$Res call(
{Site site,
PersonSafe creator,
PersonSafe? creator,
SiteAggregates counts,
String instanceHost});

$SiteCopyWith<$Res> get site;
$PersonSafeCopyWith<$Res> get creator;
$PersonSafeCopyWith<$Res>? get creator;
$SiteAggregatesCopyWith<$Res> get counts;
}

Expand All @@ -1086,7 +1086,7 @@ class _$SiteViewCopyWithImpl<$Res> implements $SiteViewCopyWith<$Res> {
creator: creator == freezed
? _value.creator
: creator // ignore: cast_nullable_to_non_nullable
as PersonSafe,
as PersonSafe?,
counts: counts == freezed
? _value.counts
: counts // ignore: cast_nullable_to_non_nullable
Expand All @@ -1106,8 +1106,12 @@ class _$SiteViewCopyWithImpl<$Res> implements $SiteViewCopyWith<$Res> {
}

@override
$PersonSafeCopyWith<$Res> get creator {
return $PersonSafeCopyWith<$Res>(_value.creator, (value) {
$PersonSafeCopyWith<$Res>? get creator {
if (_value.creator == null) {
return null;
}

return $PersonSafeCopyWith<$Res>(_value.creator!, (value) {
return _then(_value.copyWith(creator: value));
});
}
Expand All @@ -1127,14 +1131,14 @@ abstract class _$SiteViewCopyWith<$Res> implements $SiteViewCopyWith<$Res> {
@override
$Res call(
{Site site,
PersonSafe creator,
PersonSafe? creator,
SiteAggregates counts,
String instanceHost});

@override
$SiteCopyWith<$Res> get site;
@override
$PersonSafeCopyWith<$Res> get creator;
$PersonSafeCopyWith<$Res>? get creator;
@override
$SiteAggregatesCopyWith<$Res> get counts;
}
Expand Down Expand Up @@ -1163,7 +1167,7 @@ class __$SiteViewCopyWithImpl<$Res> extends _$SiteViewCopyWithImpl<$Res>
creator: creator == freezed
? _value.creator
: creator // ignore: cast_nullable_to_non_nullable
as PersonSafe,
as PersonSafe?,
counts: counts == freezed
? _value.counts
: counts // ignore: cast_nullable_to_non_nullable
Expand All @@ -1182,7 +1186,7 @@ class __$SiteViewCopyWithImpl<$Res> extends _$SiteViewCopyWithImpl<$Res>
class _$_SiteView extends _SiteView {
const _$_SiteView(
{required this.site,
required this.creator,
this.creator,
required this.counts,
required this.instanceHost})
: super._();
Expand All @@ -1193,7 +1197,7 @@ class _$_SiteView extends _SiteView {
@override
final Site site;
@override
final PersonSafe creator;
final PersonSafe? creator;
@override
final SiteAggregates counts;
@override
Expand Down Expand Up @@ -1238,7 +1242,7 @@ class _$_SiteView extends _SiteView {
abstract class _SiteView extends SiteView {
const factory _SiteView(
{required Site site,
required PersonSafe creator,
PersonSafe? creator,
required SiteAggregates counts,
required String instanceHost}) = _$_SiteView;
const _SiteView._() : super._();
Expand All @@ -1248,7 +1252,7 @@ abstract class _SiteView extends SiteView {
@override
Site get site;
@override
PersonSafe get creator;
PersonSafe? get creator;
@override
SiteAggregates get counts;
@override
Expand Down
6 changes: 4 additions & 2 deletions lib/src/v3/models/views.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 746f1fd

Please sign in to comment.