Files
phylum/client/lib/libphylum/actions/changes/create_publink_change.dart
2025-05-19 10:08:18 +05:30

41 lines
858 B
Dart

import 'package:offtheline/offtheline.dart';
import 'package:phylum/libphylum/db/db.dart';
class CreatePublinkChange extends LocalChange<Publink> {
@override
final String objectId;
final DateTime timestamp;
final String root;
final int accessLimit;
final bool protected;
final DateTime? expires;
@override
bool get persist => false;
@override
String get description => 'Creating';
const CreatePublinkChange({
required this.objectId,
required this.timestamp,
required this.root,
required this.accessLimit,
required this.protected,
required this.expires,
});
@override
Publink? apply(Publink? data) {
return Publink(
id: objectId,
created: timestamp,
root: root,
accessLimit: accessLimit,
accessed: 0,
protected: protected,
expires: expires,
);
}
}