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

Commit

Permalink
creator id can just be completely deleted
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 746f1fd commit 3549eeb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 103 deletions.
1 change: 0 additions & 1 deletion lib/src/v3/models/source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class Site with _$Site {
required String name,
String? sidebar,
String? description,
int? creatorId, //Creator ID has been removed from the Site parameters
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand Down
67 changes: 21 additions & 46 deletions lib/src/v3/models/source.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,6 @@ class _$SiteTearOff {
required String name,
String? sidebar,
String? description,
int? creatorId,
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand All @@ -1180,7 +1179,6 @@ class _$SiteTearOff {
name: name,
sidebar: sidebar,
description: description,
creatorId: creatorId,
published: published,
updated: updated,
enableDownvotes: enableDownvotes,
Expand Down Expand Up @@ -1212,8 +1210,6 @@ mixin _$Site {
String get name => throw _privateConstructorUsedError;
String? get sidebar => throw _privateConstructorUsedError;
String? get description => 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 @@ -1243,7 +1239,6 @@ abstract class $SiteCopyWith<$Res> {
String name,
String? sidebar,
String? description,
int? creatorId,
DateTime published,
DateTime? updated,
bool enableDownvotes,
Expand Down Expand Up @@ -1274,7 +1269,6 @@ class _$SiteCopyWithImpl<$Res> implements $SiteCopyWith<$Res> {
Object? name = freezed,
Object? sidebar = freezed,
Object? description = freezed,
Object? creatorId = freezed,
Object? published = freezed,
Object? updated = freezed,
Object? enableDownvotes = freezed,
Expand Down Expand Up @@ -1307,10 +1301,6 @@ class _$SiteCopyWithImpl<$Res> implements $SiteCopyWith<$Res> {
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
creatorId: creatorId == freezed
? _value.creatorId
: creatorId // ignore: cast_nullable_to_non_nullable
as int?,
published: published == freezed
? _value.published
: published // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1381,7 +1371,6 @@ abstract class _$SiteCopyWith<$Res> implements $SiteCopyWith<$Res> {
String name,
String? sidebar,
String? description,
int? creatorId,
DateTime published,
DateTime? updated,
bool enableDownvotes,
Expand Down Expand Up @@ -1413,7 +1402,6 @@ class __$SiteCopyWithImpl<$Res> extends _$SiteCopyWithImpl<$Res>
Object? name = freezed,
Object? sidebar = freezed,
Object? description = freezed,
Object? creatorId = freezed,
Object? published = freezed,
Object? updated = freezed,
Object? enableDownvotes = freezed,
Expand Down Expand Up @@ -1446,10 +1434,6 @@ class __$SiteCopyWithImpl<$Res> extends _$SiteCopyWithImpl<$Res>
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
creatorId: creatorId == freezed
? _value.creatorId
: creatorId // ignore: cast_nullable_to_non_nullable
as int?,
published: published == freezed
? _value.published
: published // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -1521,7 +1505,6 @@ class _$_Site extends _Site {
required this.name,
this.sidebar,
this.description,
this.creatorId,
required this.published,
this.updated,
required this.enableDownvotes,
Expand Down Expand Up @@ -1549,8 +1532,6 @@ class _$_Site extends _Site {
@override
final String? description;
@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 @@ -1581,7 +1562,7 @@ class _$_Site extends _Site {

@override
String toString() {
return 'Site(id: $id, name: $name, sidebar: $sidebar, description: $description, creatorId: $creatorId, published: $published, updated: $updated, enableDownvotes: $enableDownvotes, openRegistration: $openRegistration, enableNsfw: $enableNsfw, communityCreationAdminOnly: $communityCreationAdminOnly, icon: $icon, banner: $banner, requireEmailVerification: $requireEmailVerification, requireApplication: $requireApplication, applicationQuestion: $applicationQuestion, privateInstance: $privateInstance, instanceHost: $instanceHost, defaultTheme: $defaultTheme)';
return 'Site(id: $id, name: $name, sidebar: $sidebar, description: $description, published: $published, updated: $updated, enableDownvotes: $enableDownvotes, openRegistration: $openRegistration, enableNsfw: $enableNsfw, communityCreationAdminOnly: $communityCreationAdminOnly, icon: $icon, banner: $banner, requireEmailVerification: $requireEmailVerification, requireApplication: $requireApplication, applicationQuestion: $applicationQuestion, privateInstance: $privateInstance, instanceHost: $instanceHost, defaultTheme: $defaultTheme)';
}

@override
Expand All @@ -1594,7 +1575,6 @@ class _$_Site extends _Site {
const DeepCollectionEquality().equals(other.sidebar, sidebar) &&
const DeepCollectionEquality()
.equals(other.description, description) &&
const DeepCollectionEquality().equals(other.creatorId, creatorId) &&
const DeepCollectionEquality().equals(other.published, published) &&
const DeepCollectionEquality().equals(other.updated, updated) &&
const DeepCollectionEquality()
Expand Down Expand Up @@ -1622,28 +1602,26 @@ class _$_Site extends _Site {
}

@override
int get hashCode => Object.hashAll([
runtimeType,
const DeepCollectionEquality().hash(id),
const DeepCollectionEquality().hash(name),
const DeepCollectionEquality().hash(sidebar),
const DeepCollectionEquality().hash(description),
const DeepCollectionEquality().hash(creatorId),
const DeepCollectionEquality().hash(published),
const DeepCollectionEquality().hash(updated),
const DeepCollectionEquality().hash(enableDownvotes),
const DeepCollectionEquality().hash(openRegistration),
const DeepCollectionEquality().hash(enableNsfw),
const DeepCollectionEquality().hash(communityCreationAdminOnly),
const DeepCollectionEquality().hash(icon),
const DeepCollectionEquality().hash(banner),
const DeepCollectionEquality().hash(requireEmailVerification),
const DeepCollectionEquality().hash(requireApplication),
const DeepCollectionEquality().hash(applicationQuestion),
const DeepCollectionEquality().hash(privateInstance),
const DeepCollectionEquality().hash(instanceHost),
const DeepCollectionEquality().hash(defaultTheme)
]);
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(id),
const DeepCollectionEquality().hash(name),
const DeepCollectionEquality().hash(sidebar),
const DeepCollectionEquality().hash(description),
const DeepCollectionEquality().hash(published),
const DeepCollectionEquality().hash(updated),
const DeepCollectionEquality().hash(enableDownvotes),
const DeepCollectionEquality().hash(openRegistration),
const DeepCollectionEquality().hash(enableNsfw),
const DeepCollectionEquality().hash(communityCreationAdminOnly),
const DeepCollectionEquality().hash(icon),
const DeepCollectionEquality().hash(banner),
const DeepCollectionEquality().hash(requireEmailVerification),
const DeepCollectionEquality().hash(requireApplication),
const DeepCollectionEquality().hash(applicationQuestion),
const DeepCollectionEquality().hash(privateInstance),
const DeepCollectionEquality().hash(instanceHost),
const DeepCollectionEquality().hash(defaultTheme));

@JsonKey(ignore: true)
@override
Expand All @@ -1662,7 +1640,6 @@ abstract class _Site extends Site {
required String name,
String? sidebar,
String? description,
int? creatorId,
required DateTime published,
DateTime? updated,
required bool enableDownvotes,
Expand Down Expand Up @@ -1690,8 +1667,6 @@ abstract class _Site extends Site {
@override
String? get description;
@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: 0 additions & 2 deletions lib/src/v3/models/source.g.dart

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

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

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

Expand All @@ -1052,14 +1049,9 @@ mixin _$SiteView {
abstract class $SiteViewCopyWith<$Res> {
factory $SiteViewCopyWith(SiteView value, $Res Function(SiteView) then) =
_$SiteViewCopyWithImpl<$Res>;
$Res call(
{Site site,
PersonSafe? creator,
SiteAggregates counts,
String instanceHost});
$Res call({Site site, SiteAggregates counts, String instanceHost});

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

Expand All @@ -1074,7 +1066,6 @@ class _$SiteViewCopyWithImpl<$Res> implements $SiteViewCopyWith<$Res> {
@override
$Res call({
Object? site = freezed,
Object? creator = freezed,
Object? counts = freezed,
Object? instanceHost = freezed,
}) {
Expand All @@ -1083,10 +1074,6 @@ class _$SiteViewCopyWithImpl<$Res> implements $SiteViewCopyWith<$Res> {
? _value.site
: site // ignore: cast_nullable_to_non_nullable
as Site,
creator: creator == freezed
? _value.creator
: creator // ignore: cast_nullable_to_non_nullable
as PersonSafe?,
counts: counts == freezed
? _value.counts
: counts // ignore: cast_nullable_to_non_nullable
Expand All @@ -1105,17 +1092,6 @@ class _$SiteViewCopyWithImpl<$Res> implements $SiteViewCopyWith<$Res> {
});
}

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

return $PersonSafeCopyWith<$Res>(_value.creator!, (value) {
return _then(_value.copyWith(creator: value));
});
}

@override
$SiteAggregatesCopyWith<$Res> get counts {
return $SiteAggregatesCopyWith<$Res>(_value.counts, (value) {
Expand All @@ -1129,17 +1105,11 @@ abstract class _$SiteViewCopyWith<$Res> implements $SiteViewCopyWith<$Res> {
factory _$SiteViewCopyWith(_SiteView value, $Res Function(_SiteView) then) =
__$SiteViewCopyWithImpl<$Res>;
@override
$Res call(
{Site site,
PersonSafe? creator,
SiteAggregates counts,
String instanceHost});
$Res call({Site site, SiteAggregates counts, String instanceHost});

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

Expand All @@ -1155,7 +1125,6 @@ class __$SiteViewCopyWithImpl<$Res> extends _$SiteViewCopyWithImpl<$Res>
@override
$Res call({
Object? site = freezed,
Object? creator = freezed,
Object? counts = freezed,
Object? instanceHost = freezed,
}) {
Expand All @@ -1164,10 +1133,6 @@ class __$SiteViewCopyWithImpl<$Res> extends _$SiteViewCopyWithImpl<$Res>
? _value.site
: site // ignore: cast_nullable_to_non_nullable
as Site,
creator: creator == freezed
? _value.creator
: creator // ignore: cast_nullable_to_non_nullable
as PersonSafe?,
counts: counts == freezed
? _value.counts
: counts // ignore: cast_nullable_to_non_nullable
Expand All @@ -1185,10 +1150,7 @@ class __$SiteViewCopyWithImpl<$Res> extends _$SiteViewCopyWithImpl<$Res>
@JsonSerializable(fieldRename: FieldRename.snake)
class _$_SiteView extends _SiteView {
const _$_SiteView(
{required this.site,
this.creator,
required this.counts,
required this.instanceHost})
{required this.site, required this.counts, required this.instanceHost})
: super._();

factory _$_SiteView.fromJson(Map<String, dynamic> json) =>
Expand All @@ -1197,15 +1159,13 @@ class _$_SiteView extends _SiteView {
@override
final Site site;
@override
final PersonSafe? creator;
@override
final SiteAggregates counts;
@override
final String instanceHost;

@override
String toString() {
return 'SiteView(site: $site, creator: $creator, counts: $counts, instanceHost: $instanceHost)';
return 'SiteView(site: $site, counts: $counts, instanceHost: $instanceHost)';
}

@override
Expand All @@ -1214,7 +1174,6 @@ class _$_SiteView extends _SiteView {
(other.runtimeType == runtimeType &&
other is _SiteView &&
const DeepCollectionEquality().equals(other.site, site) &&
const DeepCollectionEquality().equals(other.creator, creator) &&
const DeepCollectionEquality().equals(other.counts, counts) &&
const DeepCollectionEquality()
.equals(other.instanceHost, instanceHost));
Expand All @@ -1224,7 +1183,6 @@ class _$_SiteView extends _SiteView {
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(site),
const DeepCollectionEquality().hash(creator),
const DeepCollectionEquality().hash(counts),
const DeepCollectionEquality().hash(instanceHost));

Expand All @@ -1242,7 +1200,6 @@ class _$_SiteView extends _SiteView {
abstract class _SiteView extends SiteView {
const factory _SiteView(
{required Site site,
PersonSafe? creator,
required SiteAggregates counts,
required String instanceHost}) = _$_SiteView;
const _SiteView._() : super._();
Expand All @@ -1252,8 +1209,6 @@ abstract class _SiteView extends SiteView {
@override
Site get site;
@override
PersonSafe? get creator;
@override
SiteAggregates get counts;
@override
String get instanceHost;
Expand Down
Loading

0 comments on commit 3549eeb

Please sign in to comment.